A DOIP protocol proxy method and system based on digital network

By encapsulating and parsing protocol headers between client and server proxy, Nginx does not support DOIP protocol proxy, and the service proxy of the digital object interface protocol in digital network is realized, which improves the flexibility and security of data transmission.

CN120321321BActive Publication Date: 2025-08-19BEIJING BIG DATA ADVANCED TECH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510772222.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-08-19
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The existing Nginx server does not support DOIP protocol proxy, and lacks third-party modules or plug-ins to implement the proxy function of DOIP protocol, resulting in the service proxy of the digital object interface protocol in the digital network being unable to be implemented.

Method used

The client encapsulates the requested data header, and the client agent analyzes the target device information and establishes a connection with the server agent. The server agent transmits data packets based on the target server address information and port number, realizing the DOIP protocol agent in the dual-end proxy mode.

Benefits of technology

It realizes the service agent of the logarithmic networked digital object interface protocol, improves the flexibility and security of data transmission, and is suitable for cross-domain service data transmission scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120321321B_ABST
    Figure CN120321321B_ABST
Patent Text Reader

Abstract

The present application provides a DOIP protocol proxy method and system based on the digital network, which relates to the field of digital network communication technology. The method includes: encapsulating the request data in the protocol header through the client, obtaining and sending the corresponding request data packet to the client proxy, where the request data is the digital object interface protocol request data; parsing the request data packet to determine the target device information in the protocol header of the request data packet; establishing a connection with the server proxy of the target device based on the target device information, and forwarding the request data packet to the server proxy; establishing a connection with the target server of the target device based on the target server address information and port number in the protocol header, and forwarding the request data packet; in response to the request data packet, returning a response data packet to the server proxy through the target server and transmitting it back to the client proxy; and forwarding the response data packet to the client through the client proxy. The purpose is to realize service proxy for the digital object interface protocol of the digital network.
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 DOIP protocol proxy method and system based on the digital network. Background Art

[0002] To address the limitations of the internet in the development of the digital economy, digital networking technology has been introduced as the core driving force and infrastructure of the digital economy. Built on a digital object architecture, the digital networking abstractly describes data resources as digital objects based on basic elements such as identifiers, metadata, and data entities. This makes data an independent entity, no longer dependent on specific business systems and scenarios. It provides services for different business scenarios in an independent form, solving key challenges such as data assetization, data circulation, transactions, and privacy protection.

[0003] In the digital object architecture, the DOIP (Digital Object Interface Protocol) protocol serves as an application layer protocol. Its underlying layer relies on network communication protocols to transmit DOIP messages. Compared to other application layer protocols, such as HTTP and HTTPS, DOIP provides a more flexible way to access digital objects while also offering enhanced security. However, existing protocol proxy methods are mostly implemented using Nginx. Nginx can also support proxying of other application protocols through third-party modules or plug-ins. However, native Nginx currently does not support proxying for DOIP, and there are no third-party modules or plug-ins that implement DOIP protocol proxy functionality. Summary of the Invention

[0004] In view of this, the present application provides a DOIP protocol proxy method and system based on the digital network, aiming to realize the service proxy of the digital object interface protocol of the digital network.

[0005] In a first aspect of the present application, the present application provides a DOIP protocol proxy method based on a digital network, the method comprising:

[0006] The client performs protocol header encapsulation on the request data, obtains and sends the corresponding request data packet to the client agent, wherein the request data is digital object interface protocol request data;

[0007] Parsing the request data packet through the client agent to determine target device information in a protocol header of the request data packet;

[0008] Based on the target device information, the client agent establishes a connection with the server agent of the target device and forwards the request data packet to the server agent;

[0009] According to the target server address information and port number in the protocol header, the server agent establishes a connection with the target server of the target device and forwards the request data in the request data packet;

[0010] In response to the request data, returning a response data packet to the server agent through the target server;

[0011] Transmitting the response data packet back to the client agent through the server agent;

[0012] The response data packet is forwarded to the client through the client proxy.

[0013] Optionally, parsing the request data packet by the client agent to determine the target device information in the protocol header of the request data packet includes:

[0014] Parsing the request data packet through the client agent to determine the tunnel identifier and terminator in the protocol header of the request data packet;

[0015] According to the tunnel identifier and the terminator, target device information located between the tunnel identifier and the terminator in the protocol header is determined.

[0016] Optionally, the method further includes:

[0017] Parsing the request data packet by the client agent to determine the request data in the request data packet and the checksum in the protocol header;

[0018] determining, by the client agent, whether the request data packet is legal based on the checksum;

[0019] In the case that the request data packet is illegal, the connection between the client agent and the client is disconnected, and the current request process is terminated.

[0020] Optionally, determining, by the client agent, whether the request data packet is legal based on the checksum includes:

[0021] Determining, by the client agent, a checksum corresponding to the received request data packet;

[0022] Comparing the checksum with the sum to be checked to obtain a comparison result;

[0023] If the comparison result shows that the checksum is consistent with the sum to be checked, determining that the received request data packet is legal;

[0024] If the comparison result is that the checksum is inconsistent with the sum to be checked, it is determined that the received request data packet is illegal.

[0025] Optionally, the method further includes:

[0026] The client waits for a response packet on the connection with the client proxy;

[0027] When the response data packet is obtained or the response data packet is not obtained within a preset time period, the connection between the client and the client proxy is closed.

[0028] Optionally, the method further includes:

[0029] The server agent waits for the response data packet on the connection with the target server;

[0030] When the response data packet is obtained or the response data packet is not obtained within a preset time period, the connection between the server agent and the server is closed.

[0031] Optionally, the client encapsulates the request data with a protocol header, obtains and sends the corresponding request data packet to the client proxy, including:

[0032] Determine whether to subcontract the requested data;

[0033] In the case of no sub-packaging, the client encapsulates the request data with a protocol header, obtains and sends the corresponding request data packet to the client proxy;

[0034] In the case of subpackaging, the client performs protocol header encapsulation on the first request data segment of the request data, obtains and sends each request data subpacket corresponding to the encapsulation of the request data to the client agent.

[0035] Optionally, when the request data sent by the client to the client proxy is correspondingly encapsulated request data subpackets, the method further includes:

[0036] parsing the first request data subpacket of the request data through the client agent to determine the target device information in the protocol header of the first request data subpacket;

[0037] Based on the target device information, the client agent resets the callback on the current connection with the client, establishes a connection with the server agent of the target device, and forwards each request data packet to the server agent;

[0038] The server agent establishes a connection with the target server of the target device according to the target server address information and port number in the protocol header of the first request data subpacket, and forwards the request data segments recorded in each request data subpacket to the target server;

[0039] In response to the request data segments recorded in the respective request data subpackets, returning a response data packet to the server agent through the target server;

[0040] Transmitting the response data packet back to the client agent through the server agent;

[0041] The response data packet is forwarded to the client through the client proxy.

[0042] Optionally, the server agent establishes a connection with a target server of a target device according to the target server address information and port number in the protocol header of the first request data subpacket, and forwards the request data segments recorded in each request data subpacket to the target server, including:

[0043] Parsing the first request data subpacket through the server proxy to determine the target server address information and port number in the protocol header of the first request data subpacket;

[0044] Based on the target server address information and port number, the server agent resets the callback on the current connection with the client agent, establishes a connection with the target server of the target device, and forwards the request data fragments recorded in each request data packet to the target server.

[0045] In a second aspect of the present application, the present application provides a DOIP protocol proxy system based on a digital network, the system comprising: a terminal device initiating a request and a target device responding to the request, the terminal device comprising a client agent and a client initiating the request, the target device comprising a server agent and a server responding to the request;

[0046] The client is used to perform protocol header encapsulation on the request data, obtain and send the corresponding request data packet to the client agent, wherein the request data is digital object interface protocol request data;

[0047] The client agent is configured to parse the request data packet and determine target device information in a protocol header of the request data packet;

[0048] The client agent is configured to establish a connection with a server agent of the target device based on the target device information, and forward the request data packet to the server agent;

[0049] The server agent is used to establish a connection with the target server of the target device according to the target server address information and port number in the protocol header, and forward the request data packet;

[0050] The target server is configured to respond to the request data packet and return a response data packet to the server agent;

[0051] The server agent is used to return the response data packet to the client agent;

[0052] The client agent is used to forward the response data packet to the client.

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

[0054] The embodiment of the present application provides a DOIP protocol proxy method based on the digital network, comprising: encapsulating the request data with a protocol header through the client, obtaining and sending the corresponding request data packet to the client proxy, wherein the request data is a digital object interface protocol request data; parsing the request data packet through the client proxy to determine the target device information in the protocol header of the request data packet; based on the target device information, the client proxy establishes a connection with the server proxy of the target device and forwards the request data packet to the server proxy; according to the target server address information and port number in the protocol header, the server proxy establishes a connection with the target server of the target device and forwards the request data packet; in response to the request data packet, the target server returns a response data packet to the server proxy; the server proxy returns the response data packet to the client proxy; and the client proxy forwards the response data packet to the client. Therefore, the present application aims at the scenario of cross-domain service data transmission, and while the terminal device and the target device use the dual-end proxy mode of the client proxy and the server proxy respectively, a unique protocol header is added to the original DOIP request data, and the protocol header encapsulates the target server address information and port number, verification information and the original DOIP request data before data transmission, thereby realizing a service proxy for the digital object interface protocol of the digital network.

[0055] 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

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

[0057] Figure 1 A flowchart of a DOIP protocol proxy method based on a digital network provided in an embodiment of the present application;

[0058] Figure 2A diagram of the service proxy architecture in a DOIP protocol proxy method based on a digital network provided in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of data interaction between a client agent and a client in a DOIP protocol proxy method based on a digital network provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of data interaction between a server agent and a target server in a DOIP protocol proxy method based on a digital network provided in an embodiment of the present application;

[0061] Figure 5 A schematic diagram of a protocol header in a DOIP protocol proxy method based on a digital network provided in an embodiment of the present application;

[0062] Figure 6 A schematic diagram of a DOIP protocol proxy system based on a digital network provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0065] Internet of Data: The Internet of Data 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".

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

[0067] Digital Object Interface Protocol (DOIP): One of the two basic protocols of the Internet of Things, used to access, parse, search, and use digital objects.

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

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

[0070] Figure 1 A flowchart of a DOIP protocol proxy method based on a data network is provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:

[0071] Step S1: The client encapsulates the request data with a protocol header, obtains and sends a corresponding request data packet to the client agent, wherein the request data is digital object interface protocol request data.

[0072] In this embodiment, the DOIP protocol proxy method based on a digital network provided in this application is applied to a digital network built on a digital object architecture. The digital network built 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 a 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, resolve, search, and use digital objects. For the convenience of describing the solution, the digital networks mentioned later are all digital networks built on the digital object architecture. The terminal device and the target device are each deployed with a proxy service program. The proxy service program deployed on the terminal device side is called a client proxy, and the proxy service program deployed on the target device side is called a server proxy. The proxy service program is the specific implementation tool of the proxy service of the network proxy.

[0073] In this embodiment, a terminal device in a digital network has multiple clients, each of which can initiate a request. The client-initiated request data is Digital Object Interface Protocol (DOIP) request data. When a client initiates a request, a protocol header is added to the request data before encapsulating it to form a request packet. This header includes at least the address and port number of the target server where the requested data is located. After the client completes the protocol header encapsulation of the request data to obtain the request packet, it sends the request packet to the client proxy of the terminal device.

[0074] Step S2: parsing the request data packet through the client agent to determine the target device information in the protocol header of the request data packet.

[0075] In this embodiment, after the client agent receives a request data packet sent by the client of the terminal device, it parses the request data packet to obtain the target device information in the protocol header of the request data packet. The target device information is the address information pointing to the target device, and the address information pointing to the target device is the same as the target server address information in the protocol header.

[0076] Step S3: Based on the target device information, the client agent establishes a connection with the server agent of the target device and forwards the request data packet to the server agent.

[0077] In this embodiment, based on the target device information obtained by parsing the received request data packet, the client agent establishes a connection with the target device's server agent based on the target device information, and forwards the received request data packet to the target device's server agent via a transport layer protocol within the connection. The transport layer protocol is preferably the UDP protocol, but it should be understood that the transport layer protocol may also be other types of transport layer protocols.

[0078] In this embodiment, the request data packet forwarded by the client agent to the server agent of the target device through the transport layer protocol is a request data packet in which the client agent adds the address information (i.e., IP address) and port number of the client agent. The added address information (i.e., IP address) and port number of the client agent are used by the server agent to determine the client agent to which the response data packet should be sent when the server agent returns a response data packet in response to the request data.

[0079] Step S4: According to the target server address information and port number in the protocol header, the server agent establishes a connection with the target server of the target device and forwards the request data in the request data packet.

[0080] In this embodiment, after receiving a request packet forwarded by a client agent on a terminal device, the server agent parses the request packet to obtain the target server address information and the target server port number from the protocol header of the request packet. Based on the target server address information and the target server port number, the server agent establishes a connection with the target server on the target device and forwards the request data in the request packet (i.e., the Digital Object Interface protocol request data before client encapsulation) to the target server.

[0081] Step S5: In response to the request data, a response data packet is returned to the server agent through the target server.

[0082] In this embodiment, after the target server receives the request data forwarded by the server agent, the target server determines the data content requested by the request data in response to the request data, packages the requested data content as response data into a response data packet, and returns it to the server agent of the target device. The response data packet returned by the target server in response to the request data is also a response data packet of the Digital Object Interface protocol type.

[0083] Step S6: The server agent transmits the response data packet back to the client agent.

[0084] In this embodiment, after receiving the request data packet forwarded by the client agent of the terminal device, the server agent parses and processes the request data packet to obtain information that also includes the address information and port number of the client agent carried in the request data packet. Therefore, after the server agent receives the response data packet returned by the target server, it will return the response data packet to the client agent pointed to by the address information and port number of the client agent based on the address information and port number of the client agent.

[0085] Step S7: forwarding the response data packet to the client through the client proxy.

[0086] In this embodiment, after receiving the response data packet sent back by the server agent, the client agent of the terminal device forwards the response data packet to the client that originally initiated the request based on the connection between the client agent and the client agent established when the client initiated the request.

[0087] In this embodiment, if Figure 2 As shown, the terminal device initiating the request includes multiple clients and a client agent. The client agent includes a client connection management module for managing the connection between itself and the client, a server agent connection management module for managing the connection between itself and the server agent, a time management module for managing whether the request has timed out, and a data transmission module for the client agent to forward and receive request and response packets. The target device responding to the request includes multiple servers and a server agent. The server agent includes a server connection management module for managing the connection between itself and the server, a client agent connection management module for managing the connection between itself and the client agent, a time management module for managing whether the request has timed out, and a data transmission module for the server agent to forward and receive request and response packets.

[0088] In this embodiment, the client agent and the server agent are preferably service agents implemented under the Libevent architecture. It should be understood that the client agent and the server agent can also be service agents implemented under other architectures. Figure 3 As shown, the structure of the client proxy implemented in the Libevent architecture includes: a Libevent send buffer for temporarily storing response packets; a Libevent receive buffer for temporarily storing request packets; and an event management unit. This event management unit includes: a read buffer callback event for reading request packets into the Libevent receive buffer and parsing them through a callback function; a write buffer callback event for sending response packets to the client through a callback function; and an exception event handling unit for monitoring the request process for exceptions and terminating the request in a timely manner if an exception occurs, such as a request timeout.

[0089] In this embodiment, if Figure 4 As shown, the structure of the server proxy implemented in the Libevent architecture includes: a Libevent send buffer for temporarily storing request data; a Libevent receive buffer for temporarily storing response packets; and an event management unit. This event management unit includes: a read buffer callback event for reading the response packet through a callback function; a write buffer callback event for parsing the request packet through a callback function and forwarding the request data to the target server; and an exception event handling unit for monitoring the request process for exceptions and terminating the request in a timely manner if an exception occurs, such as a request timeout.

[0090] The embodiment of the present application provides a DOIP protocol proxy method based on the digital network, comprising: encapsulating the request data with a protocol header through the client, obtaining and sending the corresponding request data packet to the client proxy, wherein the request data is a digital object interface protocol request data; parsing the request data packet through the client proxy to determine the target device information in the protocol header of the request data packet; based on the target device information, the client proxy establishes a connection with the server proxy of the target device and forwards the request data packet to the server proxy; according to the target server address information and port number in the protocol header, the server proxy establishes a connection with the target server of the target device and forwards the request data packet; in response to the request data packet, the target server returns a response data packet to the server proxy; the server proxy returns the response data packet to the client proxy; and the client proxy forwards the response data packet to the client. Therefore, the present application aims at the scenario of cross-domain service data transmission, and while the terminal device and the target device use the dual-end proxy mode of the client proxy and the server proxy respectively, a unique protocol header is added to the original DOIP request data, and the protocol header encapsulates the target server address information and port number, verification information and the original DOIP request data before data transmission, thereby realizing a service proxy for the digital object interface protocol of the digital network.

[0091] In combination with the above embodiments, in one embodiment, the present application also provides a DOIP protocol proxy method based on the digital network. In the DOIP protocol proxy method based on the digital network, step S2 may include steps S21 to S22:

[0092] Step S21: parsing the request data packet through the client agent to determine the tunnel identifier and terminator in the protocol header of the request data packet.

[0093] In this embodiment, because the target server address information and port number are of variable length, the present application places the tunnel identifier before the target server address information and port number in the protocol header, and places a terminator after the target server address information and port number. The terminator is then followed by the request data. This facilitates extracting target device information from the protocol header and distinguishing between the protocol header and the client's Digital Object Interface (DOI) request data. After receiving the request packet sent by the client, the client proxy parses the request packet to obtain the tunnel identifier and terminator from the protocol header.

[0094] Step S22: Determine the target device information between the tunnel identifier and the terminator in the protocol header according to the tunnel identifier and the terminator.

[0095] In this embodiment, according to the determined tunnel identifier and terminator in the protocol header of the request data packet, the target device information is extracted from the data segment between the tunnel identifier and the terminator.

[0096] In conjunction with the above embodiments, in one implementation, the present application also provides a DOIP protocol proxy method based on a digital network. In this DOIP protocol proxy method based on a digital network, the method further includes: parsing the request data packet by the client proxy to determine the request data in the request data packet and the checksum in the protocol header; determining whether the request data packet is legal based on the checksum; and if the request data packet is not legal, disconnecting the connection between the client proxy and the client, thereby terminating the current request process.

[0097] In this embodiment, to ensure the legitimacy of the data request, this application also sets a checksum in the protocol header, such as Figure 5As shown in the figure, the data carried in the protocol header is, in order, the tunnel identifier, target server address information, target server port number, checksum, and terminator. The tunnel identifier and terminator are custom identifiers, such as "ADDR" for the tunnel identifier and "END" for the terminator. By parsing the received request data packet, it can be distinguished that the data after the "END" character is the original request data, and the data between the "ADDR" and "END" characters is the target server address information, target server port number, and checksum.

[0098] In this embodiment, after the client proxy receives a request data packet sent by the client, it parses the request data packet to obtain a checksum in the protocol header of the request data packet, which has a fixed length. Based on this checksum, the client proxy determines whether the request data packet it has received is consistent with the request data packet initiated by the client. If inconsistent, the request data packet is determined to be illegal and will not be forwarded further. The client proxy will also disconnect from the client that initiated the request, terminating the current request process. If consistent, the request data packet is determined to be legal and the client proxy will continue with the subsequent data request process.

[0099] In combination with the above embodiments, in one embodiment, the embodiment of the present application further provides a DOIP protocol proxy method based on a digital network. In the DOIP protocol proxy method based on a digital network, the client agent determines whether the request data packet is legal based on the checksum, including: determining the checksum corresponding to the received request data packet through the client agent; comparing the checksum with the checksum to obtain a comparison result; if the comparison result is that the checksum is consistent with the checksum to be checked, determining that the received request data packet is legal; if the comparison result is that the checksum is inconsistent with the checksum to be checked, determining that the received request data packet is illegal.

[0100] In this embodiment, an optional implementation method for determining whether a request packet received by a client proxy is legitimate based on a checksum in the request packet is as follows: after receiving a request packet sent by a client, the client proxy unpacks the request packet to obtain the data recorded in the request packet, then calculates a corresponding checksum for the data recorded in the request packet. This checksum is then compared with the checksum determined to be recorded in the request packet to obtain a corresponding comparison result. If the comparison result shows that the checksum in the request packet and the checksum calculated from the data recorded in the request packet are consistent, the request packet received by the client proxy is determined to be legitimate, and the client proxy proceeds with the subsequent data request process. If the comparison result shows that the checksum in the request packet and the checksum calculated from the data recorded in the request packet are inconsistent, the request packet received by the client proxy is determined to be invalid, the client proxy will not forward the request packet further, and will simultaneously disconnect itself from the client that initiated the request, ending the current request process.

[0101] In conjunction with the above embodiments, in one implementation, the present application also provides a DOIP protocol proxy method based on a digital network. In the DOIP protocol proxy method based on a digital network, the method further includes: the client waiting for a response data packet on the connection with the client proxy; and closing the connection between the client and the client proxy if the response data packet is obtained or if the response data packet is not obtained within a preset time period.

[0102] In this embodiment, the client agent waits for a response data packet on the connection established with the client, that is, waits for the server agent to return the response data packet requested by the request data, and closes the connection between itself and the client until the response data packet returned by the server agent is received or the preset time is reached. The preset time can be set according to the actual application scenario and is not specifically limited here.

[0103] In conjunction with the above embodiments, in one embodiment, the present application also provides a DOIP protocol proxy method based on a digital network. In the DOIP protocol proxy method based on a digital network, the method further includes: the server agent waits for the response data packet on the connection with the target server; and when the response data packet is obtained or the response data packet is not obtained within a preset time period, closing the connection between the server agent and the server.

[0104] In this embodiment, the server agent waits for a response from the target server on the connection established with the target server, that is, waits for the target server to return a response data packet requested by the request data, and closes the connection between itself and the target server until the response data packet from the target server is received or the preset time is reached. The preset time can be set according to the actual application scenario and is not specifically limited here.

[0105] In combination with the above embodiments, in one embodiment, the present application also provides a DOIP protocol proxy method based on the digital network. In the DOIP protocol proxy method based on the digital network, step S1 may include steps S11 to S13:

[0106] Step S11: Determine whether to perform sub-packaging processing on the request data.

[0107] In this embodiment, before initiating a data request, the client determines whether the requested data needs to be sub-packetized based on network layer and / or transport layer protocol restrictions.

[0108] Step S12: In the case of no sub-packetization, the client performs protocol header encapsulation on the request data, obtains and sends the corresponding request data packet to the client agent.

[0109] In this embodiment, without the need to sub-packetize the request data, the client of the terminal device directly adds a protocol header before the request data when initiating the request, and then encapsulates it to form a request data packet. The protocol header includes at least the address information and port number of the target server where the data content requested by the request data is located. After the client completes the protocol header encapsulation of the request data to obtain the request data packet, it sends the request data packet to the client proxy.

[0110] Step S13: In the case of performing sub-packaging, the client performs protocol header encapsulation on the first request data segment of the request data, obtains and sends each request data sub-packaging corresponding to the request data to the client agent.

[0111] In this embodiment, when it is necessary to perform packet processing on the request data, in order to improve the efficiency of data request, when initiating a request, the client of the terminal device first splits the request data into multiple request data fragments to obtain the individual request data fragments of the request data, and then only adds a protocol header before the first request data fragment and then encapsulates it to form the first encapsulated request data sub-packet. The other request data fragments of the request data, except the first request data fragment, are directly encapsulated to form encapsulated request data sub-packets. The obtained request data is sent to the client agent in sequence through the encapsulated request data sub-packets, and the first encapsulated request data sub-packet will be sent to the client agent first. Among them, the data carried in the protocol header of the first request data sub-packet of the request data includes, in sequence, a tunnel identifier, target server address information, target server port number, checksum, and terminator. At this time, the checksum carried in the protocol header of the first request data sub-packet is used by the client agent to perform a legality check on all the encapsulated request data sub-packets corresponding to the received request data. Specifically: After the client agent receives all the request data subpackets corresponding to the encapsulated request data, it unpacks all the request data subpackets to obtain the various request data fragments of the request data recorded in all the request data subpackets. At the same time, each encapsulated request data subpacket will record the splicing order of the request data fragments. Therefore, based on the splicing order, the various request data fragments obtained by unpacking are spliced to obtain the initial complete request data. The obtained request data is then calculated to obtain the corresponding sum to be checked. The sum to be checked is then compared with the checksum recorded in the first encapsulated request data subpacket. If the two are consistent, it is determined that the checksum is legal and the subsequent data request process will continue. If the two are inconsistent, it is determined that the checksum is illegal, the connection between the client agent and the client that sent the request data is disconnected, and the current data request process ends. The checksum carried in the protocol header of the first encapsulated request data subpacket is the result calculated based on the complete request data corresponding to the first request data subpacket that has not been split into multiple request data fragments.

[0112] In combination with the above embodiments, in one embodiment, the embodiment of the present application also provides a DOIP protocol proxy method based on a digital network. In the DOIP protocol proxy method based on a digital network, when the request data sent by the client to the client proxy is a corresponding encapsulated request data subpacket, the method further includes: parsing the first request data subpacket of the request data by the client proxy to determine the target device information in the protocol header of the first request data subpacket; based on the target device information, the client proxy resets the callback on the current connection with the client, establishes a connection with the server proxy of the target device, and forwards the request data subpackets to the server proxy; according to the target server address information and port number in the protocol header of the first request data subpacket, the server proxy establishes a connection with the target server of the target device, and forwards the request data fragments recorded in the request data subpackets to the target server; in response to the request data fragments recorded in the request data subpackets, returns a response data packet to the server proxy through the target server; transmits the response data packet back to the client proxy through the server proxy; and forwards the response data packet to the client through the client proxy.

[0113] In this embodiment, when the data packet received by the client agent is a single request data sent by the client and the request data packets are obtained by encapsulating the sub-packets, the client agent parses the first request data packet received for the single request data and determines the target device information in the protocol header of the first request data packet for the single request data. After the client completes the parsing of the first request data packet for the single request data, the client agent resets the callback on the current connection with the client. Based on the callback reset, the protocol header will no longer be parsed after other request data packets of the single request data are subsequently received on the connection, thereby improving data request efficiency. At the same time, based on the target device information, the client agent establishes a connection with the server agent of the target device and forwards all the request data packets corresponding to the received single request data to the server agent. The first request data packet encapsulated corresponding to the single request data will be forwarded to the server agent first.

[0114] In this embodiment, the server-side agent parses the first request data subpacket corresponding to the received single request data package, and determines the target server address information and port number in the protocol header of the first request data subpacket. Based on the determined target server address information and port number, the server-side agent establishes a connection with the target server of the target device, and forwards the request data fragments recorded in all request data subpackets of the single request data to the target server. The target server splices the request data fragments recorded in all request data subpackets of the single request data according to the splicing order to obtain the digital object interface protocol request data originally issued by the client, and in response to the digital object interface protocol request data, determines the data content requested by the digital object interface protocol request data, and packages the requested data content as response data to form a response data packet and returns it to the server-side agent of the target device. The response data packet returned by the target server in response to the request data is also a response data packet of the digital object interface protocol type.

[0115] In combination with the above embodiments, in one embodiment, the embodiment of the present application also provides a DOIP protocol proxy method based on the digital network. In the DOIP protocol proxy method based on the digital network, according to the target server address information and port number in the protocol header of the first request data subpacket, the server proxy establishes a connection with the target server of the target device, and forwards the request data fragments recorded in each request data subpacket to the target server, including: parsing the first request data subpacket by the server proxy to determine the target server address information and port number in the protocol header of the first request data subpacket; based on the target server address information and port number, the server proxy resets the callback on the current connection with the client proxy, establishes a connection with the target server of the target device, and forwards the request data fragments recorded in each request data subpacket to the target server.

[0116] In this embodiment, the server-side agent parses the first request data subpacket corresponding to the received single request data encapsulation, and determines the target server address information and port number in the protocol header of the first request data subpacket. After the server-side agent completes the parsing of the first request data subpacket, the server-side agent resets the callback on the current connection with the client agent. Based on the callback reset, the protocol header will no longer be parsed after other request data subpackets of the single request data are subsequently received on the connection, thereby improving data request efficiency. At the same time, based on the target server address information and port number, the server-side agent establishes a connection with the target server of the target device, and forwards the request data fragments recorded in all request data subpackets corresponding to the received single request data to the target server.

[0117] Based on the same inventive concept, this application provides a DOIP protocol proxy system based on the digital network, such as Figure 6 As shown, the system 600 includes: a terminal device 601 that initiates a request and a target device 602 that responds to the request, the terminal device 601 includes a client agent 6011 and a client 6012 that initiates a request, and the target device 602 includes a server agent 6021 and a server 6022 that responds to the request;

[0118] The client 6012 is used to perform protocol header encapsulation on the request data, obtain and send the corresponding request data packet to the client agent, wherein the request data is the digital object interface protocol request data;

[0119] The client agent 6011 is used to parse the request data packet and determine the target device information in the protocol header of the request data packet;

[0120] The client agent 6011 is used to establish a connection with the server agent of the target device based on the target device information, and forward the request data packet to the server agent;

[0121] The server agent 6021 is used to establish a connection with the target server of the target device according to the target server address information and port number in the protocol header, and forward the request data packet;

[0122] The target server is configured to respond to the request data packet and return a response data packet to the server agent;

[0123] The server agent 6021 is used to return the response data packet to the client agent;

[0124] The client agent 6011 is used to forward the response data packet to the client.

[0125] Optionally, the client agent 6011 is used to parse the request data packet to determine the tunnel identifier and terminator in the protocol header of the request data packet; and to determine the target device information located between the tunnel identifier and terminator in the protocol header based on the tunnel identifier and terminator.

[0126] Optionally, the client agent 6011 is used to parse the request data packet to determine the request data in the request data packet and the checksum in the protocol header; and to determine whether the request data packet is legal based on the checksum; if the request data packet is not legal, disconnect the connection between the client agent and the client, and end the current request process.

[0127] Optionally, the client agent 6011 is used to determine the checksum corresponding to the received request data packet; and to compare the checksum with the checksum to obtain a comparison result; and to determine that the received request data packet is legal when the comparison result is that the checksum and the checksum are consistent; and to determine that the received request data packet is illegal when the comparison result is that the checksum and the checksum are inconsistent.

[0128] Optionally, the client 6012 is used to wait for a response data packet on the connection with the client proxy; and to close the connection between the client and the client proxy when the response data packet is obtained or the response data packet is not obtained within a preset time period.

[0129] Optionally, the server agent 6021 is used to wait for the response data packet on the connection with the target server; and to close the connection between the server agent and the server when the response data packet is obtained or the response data packet is not obtained within a preset time period.

[0130] Optionally, the client 6012 is used to determine whether to perform sub-packet processing on the request data; and, when sub-packet processing is not performed, to perform protocol header encapsulation on the request data, obtain and send the corresponding request data packet to the client agent; and, when sub-packet processing is performed, to perform protocol header encapsulation on the first request data sub-packet of the request data, obtain and send each request data sub-packet corresponding to the encapsulation of the request data to the client agent.

[0131] Optionally, the client agent 6011 is configured to parse a first request data subpacket of the request data and determine target device information in a protocol header of the first request data subpacket; and, based on the target device information, reset a callback on a current connection with the client, establish a connection with a server agent of the target device, and forward each request data subpacket to the server agent.

[0132] The server agent 6021 is configured to establish a connection with the target server of the target device according to the target server address information and port number in the protocol header of the first request data subpacket, and forward the request data segments recorded in each request data subpacket to the target server;

[0133] The target server is configured to return a response data packet to the server agent in response to the request data subpacketized in each request data subpacket;

[0134] The server agent 6021 is used to return the response data packet to the client agent;

[0135] The client agent 6011 is used to forward the response data packet to the client.

[0136] Optionally, the server agent 6021 is used to parse the first request data packet and determine the target server address information and port number in the protocol header of the first request data packet; and to reset the callback on the current connection with the client agent based on the target server address information and port number, establish a connection with the target server of the target device, and forward the request data fragments recorded in each request data packet to the target server.

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

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

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

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

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

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

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

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

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

[0146] 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 DOIP protocol proxy method based on digital network, characterized in that: The method comprises: The client performs protocol header encapsulation on the request data, obtains and sends the corresponding request data packet to the client agent, wherein the request data is digital object interface protocol request data; Parsing the request data packet through the client agent to determine target device information in a protocol header of the request data packet; Based on the target device information, the client agent establishes a connection with the server agent of the target device and forwards the request data packet to the server agent; According to the target server address information and port number in the protocol header, the server agent establishes a connection with the target server of the target device and forwards the request data in the request data packet; In response to the request data, returning a response data packet to the server agent through the target server; Transmitting the response data packet back to the client agent through the server agent; forwarding the response data packet to the client through the client proxy; The step of parsing the request data packet by the client agent to determine the target device information in the protocol header of the request data packet includes: parsing the request data packet by the client agent to determine the tunnel identifier and terminator in the protocol header of the request data packet; and determining the target device information located between the tunnel identifier and terminator in the protocol header based on the tunnel identifier and terminator; Among them, the DOIP protocol proxy method based on the digital network also includes: parsing the request data packet through the client proxy to determine the request data in the request data packet and the checksum in the protocol header; based on the checksum, determining whether the request data packet is legal through the client proxy; if the request data packet is illegal, disconnecting the connection between the client proxy and the client to end the current request process.

2. A DOIP protocol proxy method based on digital networking according to claim 1, characterized in that: Determining, by the client agent, whether the request data packet is legal based on the checksum includes: Determining, by the client agent, a checksum corresponding to the received request data packet; Comparing the checksum with the sum to be checked to obtain a comparison result; If the comparison result shows that the checksum is consistent with the sum to be checked, determining that the received request data packet is legal; If the comparison result is that the checksum is inconsistent with the sum to be checked, it is determined that the received request data packet is illegal.

3. A DOIP protocol proxy method based on digital networking according to claim 1, characterized in that: The method further comprises: The client waits for a response packet on the connection with the client proxy; When the response data packet is obtained or the response data packet is not obtained within a preset time period, the connection between the client and the client proxy is closed.

4. A DOIP protocol proxy method based on digital networking according to claim 1, characterized in that: The method further comprises: The server agent waits for the response data packet on the connection with the target server; When the response data packet is obtained or the response data packet is not obtained within a preset time period, the connection between the server agent and the server is closed.

5. A DOIP protocol proxy method based on digital networking according to claim 1, characterized in that: The client encapsulates the request data with a protocol header, obtains and sends the corresponding request data packet to the client proxy, including: Determine whether to subcontract the requested data; In the case of no sub-packaging, the client encapsulates the request data with a protocol header, obtains and sends the corresponding request data packet to the client proxy; In the case of subpackaging, the client performs protocol header encapsulation on the first request data segment of the request data, obtains and sends each request data subpacket corresponding to the encapsulation of the request data to the client agent.

6. A DOIP protocol proxy method based on digital networking according to claim 5, characterized in that: In the case where the request data sent by the client to the client proxy is correspondingly encapsulated request data subpackets, the method further includes: parsing a first request data subpacket of the request data through the client agent to determine target device information in a protocol header of the first request data subpacket; Based on the target device information, the client agent resets the callback on the current connection with the client, establishes a connection with the server agent of the target device, and forwards each request data packet to the server agent; The server agent establishes a connection with the target server of the target device according to the target server address information and port number in the protocol header of the first request data subpacket, and forwards the request data segments recorded in each request data subpacket to the target server; In response to the request data segments recorded in the respective request data subpackets, returning a response data packet to the server agent through the target server; Transmitting the response data packet back to the client agent through the server agent; The response data packet is forwarded to the client through the client proxy.

7. A DOIP protocol proxy method based on digital networking according to claim 6, characterized in that: The server agent establishes a connection with the target server of the target device according to the target server address information and port number in the protocol header of the first request data subpacket, and forwards the request data segments recorded in each request data subpacket to the target server, including: Parsing the first request data subpacket through the server proxy to determine the target server address information and port number in the protocol header of the first request data subpacket; Based on the target server address information and port number, the server agent resets the callback on the current connection with the client agent, establishes a connection with the target server of the target device, and forwards the request data fragments recorded in each request data packet to the target server.

8. A DOIP protocol proxy system based on digital network, 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 client agent and a client that initiates the request, and the target device includes a server agent and a server that responds to the request; The client is used to perform protocol header encapsulation on the request data, obtain and send the corresponding request data packet to the client agent, wherein the request data is digital object interface protocol request data; The client agent is configured to parse the request data packet and determine target device information in a protocol header of the request data packet; The client agent is configured to establish a connection with a server agent of the target device based on the target device information, and forward the request data packet to the server agent; The server agent is used to establish a connection with the target server of the target device according to the target server address information and port number in the protocol header, and forward the request data packet; The target server is configured to respond to the request data packet and return a response data packet to the server agent; The server agent is used to return the response data packet to the client agent; The client agent is used to forward the response data packet to the client; The client agent is configured to parse the request data packet and determine the target device information in the protocol header of the request data packet, specifically comprising: parsing the request data packet by the client agent to determine the tunnel identifier and terminator in the protocol header of the request data packet; and determining the target device information located between the tunnel identifier and terminator in the protocol header based on the tunnel identifier and terminator; The client agent is used to parse the request data packet to determine the request data in the request data packet and the checksum in the protocol header; and to determine whether the request data packet is legal based on the checksum; and to disconnect the connection between the client agent and the client and end the current request process if the request data packet is not legal.

Citation Information

Patent Citations

  • Communication method and device

    CN111726384A

  • Protocol proxy method and device

    CN114244556A