[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111464573B - Network communication system, method and device for data forwarding across communication protocols - Google Patents

Network communication system, method and device for data forwarding across communication protocols Download PDF

Info

Publication number
CN111464573B
CN111464573B CN201910052652.2A CN201910052652A CN111464573B CN 111464573 B CN111464573 B CN 111464573B CN 201910052652 A CN201910052652 A CN 201910052652A CN 111464573 B CN111464573 B CN 111464573B
Authority
CN
China
Prior art keywords
service
network
identifier
packet
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910052652.2A
Other languages
Chinese (zh)
Other versions
CN111464573A (en
Inventor
胡俊喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201910052652.2A priority Critical patent/CN111464573B/en
Publication of CN111464573A publication Critical patent/CN111464573A/en
Application granted granted Critical
Publication of CN111464573B publication Critical patent/CN111464573B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a network communication system, a method and a device for transmitting data across communication protocols, wherein a service identifier S_INFO in a service request data packet sent to a service end by a client through a network service device comprises first addressing information of the service end and at least one of a plurality of service function codes FID provided in the service end, a single or a plurality of network service devices transmit the service request data packet to the service end for the client, a service response data packet responded by the service end and the service request data packet establish a first corresponding relation according to the service identifier S_INFO, and the network service device searches a corresponding path of the service request data packet for the service response data packet according to the first corresponding relation so as to return the service response data packet to the client. The system provided by the invention can be used for deploying network units of the order of billions across multiple countries and regions to form a complete system, so that any two endpoints in the system have communication capability.

Description

Network communication system, method and device for data forwarding across communication protocols
Technical Field
The present invention relates to the field of internet and internet of things, and in particular, to a network communication system, method and device for forwarding data across communication protocols.
Background
The internet is communicated with the world based on the TCPIP protocol, and the occurrence of the Internet of things is because the TCPIP protocol is not applicable in many occasions, the Internet of things is networked by utilizing various communication protocols, and then the Internet of things is connected with the Internet through an Internet of things gateway.
Disclosure of Invention
The invention aims to solve the technical problems that communication modes between various equipment endpoints or program endpoints in the Internet and the Internet of things are various, and the communication capability between any two endpoints cannot be ensured. The invention provides a network communication system, a method and a device for data forwarding across communication protocols, which have scalability, can provide communication capability for two independent local equipment endpoints or program endpoints, can place millions of equipment endpoints or program endpoints in one network unit, can also form a complete system by deploying billions of network units across multiple countries and regions, realizes the communication capability among all endpoints in the system, and ensures that any two endpoints have the communication capability.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention discloses a network communication system for data forwarding across communication protocols, including a client, a server, and a network element; the network element comprises at least one network service device; if the number of the network service devices contained in the network unit exceeds one, establishing direct or indirect communication connection between the network service devices;
The client is used for establishing communication connection with one network service device and sending a service request data packet to the network service device, wherein the service request data packet comprises a service identifier S_INFO, and the service identifier S_INFO comprises first addressing information for addressing the service terminal and at least one of a plurality of service function codes FID provided inside the service terminal;
the service end is used for establishing communication connection with one network service device and sending a service response data packet to the network service device according to the received service request data packet, wherein the service response data packet comprises the service identifier S_INFO, and a first corresponding relation is established between the service response data packet and the service request data packet according to the service identifier S_INFO;
the network service device is used for forwarding the service request data packet once or multiple times by utilizing a single network service device or multiple network service devices according to the first addressing information, and recording a path from which the service request data packet is sent by taking the service identifier S_INFO as a keyword in each forwarding; the network service device is further configured to search, through the first correspondence, a path of a corresponding service request packet for the service response packet, so as to return the service response packet to the client.
Optionally, each of said network service devices is assigned a device identification PID for identifying said network service device within range of said network element;
the server is also allocated a server identifier DID for identifying the server within the range of the network service device to which the server is connected in a communication manner;
the service request data packet and the service response data packet further comprise a direction switch for distinguishing the service request data packet and the service response data packet, and the first addressing information explicitly or implicitly comprises the service end identifier DID of the service end and the device identifier PID of the network service device to which the service end is communicatively connected;
the first correspondence includes two cases, one is that the service request packet and the service response packet have the same service identifier s_info, and the other is that the service request packet and the service response packet have the service identifier s_info with the intersection of the service function codes FID and the other is the same.
Optionally, the network service device comprises a receiver, a request data processing module and a response data processing module;
The receiver is configured to receive the service request packet and the service response packet from a client, a server, or other network service devices, determine a class of the service request packet according to the direction switch, submit the service request packet and a communication address peer_addr of a counterpart when the service request packet is received to the request data processing module, and submit the service response packet to the response data processing module;
the request data processing module is used for generating a route record corresponding to the service identifier S_INFO and the peer_addr in the service request data packet, inserting or updating the route record in a return route table, and forwarding the service request data packet to the local service end or the optimal one of the connected and known other network service devices according to the prompt of the service identifier S_INFO so that the service request data packet is forwarded to the service end after being forwarded for a plurality of times;
the response data processing module is configured to search the route record of the service request data packet corresponding to the service response data packet according to the first correspondence, and forward the service response data packet to the peer_addr in the route record conforming to the first correspondence.
Optionally, a deletion rule is set for the route record, where the deletion rule includes deletion after receiving an instruction to delete, returning data once, and deleting the service request packet that does not correspond to the route record for more than one period of time.
Optionally, the physical communication connection channel when the network service device receives the service request data packet is the same as or different from the physical communication connection channel when the service request data packet is forwarded, the communication protocol used when the network service device receives the service request data packet is the same as or different from the communication protocol used when the service request data packet is forwarded, and the peer_addr includes information of the physical communication connection channel, the communication protocol used and an address used by the service response data packet sent back according to the communication protocol.
Optionally, the service request packet and the service response packet further include a multi-function switch for marking whether the service identifier s_info includes a plurality of consecutive service function codes FID, and a value of one of "0" and "1" of the multi-function switch indicates that the service identifier s_info further includes multi-function code data for representing a plurality of consecutive service function codes FID with the service function code FID as a reference point, and when the network service device queries the return routing table, the network service device determines whether to forward the service response packet according to whether the service identifier s_info in the service response packet and the service identifier s_info in the return routing table include any one of the same service function codes FID of the same service end.
Optionally, the service end identifier DID is a fixed length integer, the length is between 8 bits and 64 bits, and the rule set for the integer is set so that the service request packet including the specific integer as the service end identifier DID is forwarded to a plurality of service ends communicatively connected to the same network service device.
Optionally, when the service request data packets sent by the plurality of clients in the same period of time include the same service identifier s_info or the service function codes FID have intersections and other parts are the same, the same service response data packet is returned to the plurality of clients.
Optionally, the service request packet and the service reply packet further comprise additional function codes for additional definition of the service function code FID.
Optionally, the service request packet and the service response packet further include data length information for determining a packet boundary in the streaming data to extract the packet.
Optionally, the service request packet and the service response packet further include a plurality of backup switches for expanding system functions, each backup switch is 1 bit, and one of "0" and "1" of the extended backup switch is a value indicating that the service request packet and the service response packet further include more backup switches.
Optionally, the service request data packet and the service response data packet further include a user switch with bit information, and one of "0" and "1" of the user switch is valued to indicate that the service identifier s_info includes a user identifier UID for identifying user identity information or distinguishing different clients.
Optionally, the service request data packet and the service response data packet further include a priority switch of bit information, and one of "0" and "1" of the priority switch takes a value, which indicates that the service request data packet and the service response data packet further include priority codes for prompting data priority levels.
Optionally, the service request data packet and the service response data packet further include a serial number switch of bit information, and a value of one of "0" and "1" of the serial number switch indicates that the service request data packet and the service response data packet further include data packet serial numbers for splitting data of the data packet and then sending the data packet for multiple times.
Optionally, each network service device further allocates a broadcaster identifier pid_b for facilitating the client and the server to search for the network service device, where the broadcaster identifier pid_b belongs to a special case of the device identifier PID, and the broadcaster identifiers pid_b of all the network service devices are the same; the client obtains the response of the network service device by broadcasting and sending a broadcast data packet, thereby finding the network service device and establishing communication connection, wherein the broadcast data packet accords with the specification of the service request data packet and comprises the identifier PID_B of the broadcasting device; the server obtains the response of the network service device by broadcasting and sending broadcast data, thereby finding the network service device and establishing communication connection, wherein the broadcast data packet accords with the specification of the service request data packet and contains the identifier PID_B of the broadcast device; the network service device does not forward the service request packet containing the broadcaster identification pid_b.
Optionally, each network service device further assigns a service end identifier DID, and the service end identifiers DID of all the network service devices are the same.
Optionally, the service function code FID is an integer with a fixed length, the length is between 8 bits and 64 bits, a standardized service function interval and a custom service function interval are divided according to a value interval of the integer, and the function definition of the service function code FID with a value falling in the standardized service function interval is standardized.
Optionally, a standardized service function code fid_ping for testing whether the service terminal is online is defined in the standardized service function section.
Optionally, the network service devices are divided into three levels, including a first-level network service device of a top level, a second-level network service device and a third-level network service device of a bottom level, each third-level network service device is communicatively connected to one second-level network service device or one first-level network service device, each second-level network service device is communicatively connected to all first-level network service devices, each first-level network service device is communicatively connected to all other first-level network service devices, communication connections between network service devices are used for forwarding the network request data packet, and also used for distributing internal shared data so that each network service device stores one piece of the internal shared data, and the internal shared data includes the device identification PID and communication address information of each network service device in the network unit; the device identification PID adopts an integer with a fixed length, the length is between 8 bits and 64 bits, and a rule is set for the integer, so that the hierarchy of each network service device can be deduced according to the number of the device identification PID, and the network service device of the upper stage, which is in communication connection with each three-stage network service device, can be deduced according to the number of the device identification PID; the network service device records the communication address information of other network service devices and is used for establishing direct communication connection with the other network service devices so as to forward the network request data packet.
Optionally, the network service device obtains the response of the network service device at the previous stage by broadcasting and sending a broadcast data packet, so as to find the network service device at the previous stage and establish a communication connection, wherein the broadcast data packet accords with the specification of the service request data packet and contains the identifier PID_B of the broadcast device; and under the condition that the network service device searching of the previous stage fails, selecting whether to customize the network service device as the first stage according to preset settings.
Optionally, a plurality of mutually independent physical communication connection channels are established between the network service devices, so as to enhance the throughput capacity of data forwarding.
Optionally, a physical communication connection channel for forwarding data is selected from a plurality of mutually independent physical communication connection channels between two network service devices according to the priority code included in the service request data packet.
Optionally, a server real NAME identifier d_name for identifying the server within the network element is also allocated to the server, the server real NAME identifier d_name of the server and the device identifier PID of the network service device to which the server is communicatively connected and the server identifier DID of the server form a second corresponding relationship, and the internal shared data further includes a record of the second corresponding relationship; the service identifier s_info also contains a real-NAME switch with bit information, and one of "0" and "1" of the real-NAME switch takes a value, which indicates that the service identifier s_info contains one of the service-side real-NAME identifiers d_name, otherwise the service identifier s_info explicitly contains one of the device identifiers PID and one of the service-side identifiers DID.
Optionally, at least two network units are included, and a central service system is also included; each of said network elements being assigned at least one network identification NID for identifying said network element within said network communication system; each network unit opens at least one network service device to the outside as an external network service device for providing an external communication address w_addr to receive and send the service request data packet and the service response data packet, and the external network service device is also used for being connected to the central service system in a communication way; the internal shared data further comprises the network identification NID of the network element and the device identification PID of the external network service device; the central service system is used for forwarding the service request data packet and the service response data packet between two network units, and is also used for registering and inquiring the network identifier NID and the external communication address W_ADDR of the network units; the service request data packet and the service response data packet further comprise a network identification switch for marking whether the service identifier s_info contains the network identifier NID, the service identifier s_info does not contain the network identifier NID, which indicates that communication only occurs in the same network element, otherwise, if the network identifier NID contained in the service identifier s_info does not belong to the network element where the network identifier NID is contained, the service request data packet and the service response data packet are forwarded between the two network elements, and the external network service device queries the central service system to obtain the external communication address w_addr of the network element of the other party, and then establishes communication connection between the two network elements for forwarding, or submits the communication connection to the central service system for forwarding.
Optionally, the server-side real NAME identifier d_name has a fixed bit number, and is obtained by converting the server-side character string real NAME into an integer through a specific algorithm and intercepting the fixed bit number therein; the user identification UID has a fixed bit number, is obtained by changing the real name of a user character string into an integer through a specific algorithm and intercepting the fixed bit number in the integer; the network identifier NID has a fixed bit number, which is obtained by changing the real name of a network character string into an integer through a specific algorithm and intercepting the fixed bit number therein; the server-side character string real name, the user character string real name and the network character string real name are coded by UNICODE.
Optionally, a standardized service function code fid_connect for establishing an optimized path between the client and the server is defined in the standardized service function interval.
Optionally, a standardized server-side character string real-name list composed of at least one server-side character string real-name is provided, wherein each server-side character string real-name represents a standardized server-side with a specific function.
Optionally, the two network elements are friendly network elements, and a friendly communication connection for forwarding the service request data packet and the service response data packet between the two friendly network elements is established by using a dedicated physical communication connection channel; the internal shared data further comprises the network identification NID of the friendly network element and the device identification PID of the external network service device related to the friendly communication connection.
Optionally, the system comprises two or more central service systems, which are respectively arranged in different countries or regions, each central service system is allocated with a region identifier c_code, communication connection is established between any two central service systems, and the two central service systems are used for mutually inquiring the external communication address w_addr of the network unit within the range of the other party and forwarding the service request data packet and the service response data packet; the service request packet and the service response packet further include a zone switch with bit information, where one of "0" and "1" of the zone switch takes a value, which indicates that the network identifier NID includes the zone identifier c_code of the central service system to which the corresponding network element is communicatively connected.
Optionally, the NAT server is also included; the network units and the central service system establish communication connection by adopting a TCPIP protocol, the two network units are connected to the NAT server by adopting the TCPIP protocol, and the direct communication connection between the two network units is realized by the help of the NAT server, or the service request data packet and the service response data packet between the two network units are forwarded by the NAT server directly.
In a second aspect, an embodiment of the present invention discloses a network communication method for data forwarding across communication protocols, including the following steps:
s1, setting a network unit so that at least one network service device is contained in the network unit, and if the number of the network service devices exceeds one, enabling the network service devices to establish direct or indirect communication connection;
s2, a plurality of service function codes FID are provided inside the service end, so that the service end and one network service device are in communication connection, and the service end obtains first addressing information for addressing the service end in the network unit range;
s3, the client establishes communication connection with one network service device and sends a service request data packet to the network service device, wherein the service request data packet comprises a service identifier S_INFO, and the service identifier S_INFO comprises the first addressing information of the service terminal and at least one service function code FID of the service terminal;
s4, receiving the service request data packet at the network service device, recording a path sent by the service request data packet by taking the service identifier S_INFO in the service request data packet as a keyword, and then forwarding the service request data packet once or forwarding the service request data packet for a plurality of times through direct or indirect communication connection between the network service devices according to the first addressing information, and then sending the service request data packet to the corresponding service end;
S5, receiving the service request data packet at the service end, and sending a corresponding service response data packet to the network service device in communication connection with the service end according to the service request data packet, wherein the service response data packet comprises the service identifier S_INFO, and a first corresponding relation is established between the service response data packet and the service request data packet according to the service identifier S_INFO;
s6, receiving the service response data packet at the network service device, searching a path of a corresponding service request data packet for the service response data packet according to the first corresponding relation, and reversely returning the service response data packet from the path to the client.
Optionally, in the step S1, each network service device is assigned a device identifier PID for identifying the network service device within the network element;
in the step S2, a service identifier DID for identifying the service within the range of the network service device in communication connection is further allocated to the service; the first addressing information explicitly or implicitly comprises the service end identifier DID of the service end and the device identifier PID of the network service device which the service end is in communication connection with;
In the step S3, the service request packet further includes a direction switch for distinguishing the service request packet from the service response packet, and the service identifier s_info further includes the service function code FID of the service end;
in the step S5, the service response packet further includes a direction switch for distinguishing the service request packet from the service response packet; the first correspondence includes two cases, one is that the service request packet and the service response packet have the same service identifier s_info, and the other is that the service request packet and the service response packet have the service identifier s_info with the intersection of the service function codes FID and the other is the same.
Optionally, in the step S4, the step of recording the path from which the service request packet is sent is as follows:
s4a records the communication address peer_addr of the peer when receiving the service request data packet, and forms a route record with the service identifier S_INFO, and inserts or updates the route record in a return route table;
in the step S4, the step of forwarding the service request packet to the server side is as follows:
S4b judges whether the service request data packet corresponds to the service end which is in communication connection with the service end according to the service identifier S_INFO, if so, the service request data packet is forwarded to the service end, if not, an optimal network service device is selected from other connected and known network service devices according to the service identifier S_INFO, the service request data packet is forwarded to the optimal next network service device, and the same process as the steps S4, S4a and S4b is executed in the optimal next network service device until the service request data packet is forwarded to the service end;
in the step S6, the step of returning the service response packet to the client at the network service device is as follows:
s6a queries the return route table, finds the route record with the service identifier S_INFO identical to the service identifier S_INFO or with the service function code FID included in the service identifier S_INFO intersected with the service identifier S_INFO and the other part identical to the service function code FID, forwards the service response data packet to the peer_addr in the route record, if the peer_addr corresponds to a client, the network service device corresponds to the peer_addr, and performs the same steps as the step S6 and the step S6a on the corresponding network service device until the service response data packet is forwarded to the client.
Optionally, in the step S3, the service request packet further includes a delete switch for bit information and a single switch, where one value of "0" and "1" of the delete switch represents a delete instruction, and one value of "0" and "1" of the single switch represents that only one data needs to be returned; in the step S6, the service response packet received by the network service device further includes the delete switch and the single switch; if the deletion switch is indicated as the deletion instruction, deleting the route record with the service identifier S_INFO identical to the service identifier S_INFO in the return route table according to the service identifier S_INFO contained in the service response data packet; if the single switch indicates that only one data needs to be returned, deleting the routing record with the same service identifier S_INFO in the return route table according to the service identifier S_INFO contained in the service response data packet after the service response data packet is forwarded; and if the route record is not updated in the set time, deleting the route record.
Optionally, in the step S4, the step S4a, and the step S4b, a physical communication connection channel when the network service device receives the service request packet is the same as or different from a physical communication connection channel when the service request packet is forwarded, a communication protocol used when the network service device receives the service request packet is the same as or different from a communication protocol used when the service request packet is forwarded, and the peer_addr includes information of the physical communication connection channel, a communication protocol used, and a communication address used for sending the returned service response packet according to the communication protocol.
Optionally, in the step S3, the service request packet further includes a multi-function switch with bit information, where a value of one of "0" and "1" of the multi-function switch indicates that the service identifier s_info further includes multi-function code data for representing a plurality of consecutive service function codes FID with the service function code FID as a reference point; in the step S5, the service response packet further includes a multi-function switch, where a value of one of "0" and "1" of the multi-function switch indicates that the service identifier s_info further includes multi-function code data for representing a plurality of consecutive service function codes FID with the service function code FID as a reference point.
Optionally, in the step S2, the service end identifier DID is an integer with a fixed length, and the length is between 8 bits and 64 bits; and in the step S4 and the step S4b, the service request data packet is forwarded to all the service terminals represented by the service terminal identification DID.
Optionally, in the step S2, the service request packets sent by the plurality of clients at the same time include the same service identifier s_info or the service function codes FID have intersections and other parts are the same; in the step S6, since the same service response packet finds a plurality of route records in the return route table according to the first correspondence, the service response packet is returned to a plurality of clients.
Optionally, in the step S3, the service request packet further includes an additional function code for additional definition of the service function code FID; in the step S5, the service response packet further includes the additional function code.
Optionally, in the step S3, the service request packet further includes data length information for extracting a packet from the streaming data; in the step S5, the service response packet further includes the data length information.
Optionally, in the step S3, the service request packet further includes at least one spare switch for extending a function, where each spare switch is 1 bit; in the step S5, the service response packet further includes at least one of the standby switches.
Optionally, in the step S3, the service request packet further includes a user switch with bit information, and one of "0" and "1" of the user switch is valued, which indicates that the service identifier s_info includes a user identifier UID for identifying user identity information or distinguishing different clients; in the step S5, the service response packet further includes the user switch, and one of "0" and "1" of the user switch is valued, which indicates that the service identifier s_info of the service response packet includes the user identifier UID.
Optionally, in the step S3, the service request packet further includes a priority switch of bit information, where a value of one of "0" and "1" of the priority switch indicates that the service request packet further includes a priority code for prompting a priority level of data; in the step S5, the service response packet further includes a priority switch, where a value of one of "0" and "1" of the priority switch indicates that the service response packet further includes the priority code.
Optionally, in the step S3, the service request packet further includes a serial number switch of bit information, where a value of one of "0" and "1" of the serial number switch indicates that the service request packet further includes a packet serial number for dividing one service request packet into multiple transmissions; in the step S5, the service response packet further includes a sequence number switch, and a value of one of "0" and "1" of the sequence number switch indicates that the service response packet further includes the packet sequence number.
Optionally, in the step S1, a broadcaster identifier pid_b is further allocated to each network service device, so that the client and the server can search for the network service device, where the broadcaster identifier pid_b belongs to a special case of the device identifier PID, and the broadcaster identifiers pid_b of all the network service devices are the same;
In the step S2, the method for establishing a communication connection between the server and the network service device includes the following steps:
s2a broadcasts and sends the service request data packet at the service end, wherein the service request data packet comprises the broadcasting device identifier PID_B, the network service device receives the service request data packet and sends reply information, the reply information comprises the communication address of the network service device, and the service end receives the communication address and establishes communication connection with the network service device;
in the step S3, the method for establishing a communication connection between the client and the network service device includes the steps of:
s3a, broadcasting and sending the service request data packet at the client, wherein the service request data packet comprises the broadcasting device identifier PID_B, receiving the service request data packet at the network service device, and sending reply information, wherein the reply information comprises a communication address of the reply information, receiving the communication address at the client and establishing communication connection with the network service device.
Optionally, in the step S1, each network service device is further allocated one service end identifier DID, where the service end identifiers DID of all the network service devices are the same.
Optionally, in the step S2, the service function code FID is an integer with a fixed length, the length is between 8 bits and 64 bits, a standardized service function interval and a custom service function interval are divided according to a value interval of the integer, and a function definition of the service function code FID with a value falling in the standardized service function interval is standardized.
Optionally, in the step S2, a standardized service function code fid_ping for testing whether the service terminal is online is defined in the standardized service function interval.
Optionally, in the step S1, the network service devices are divided into three levels, including a first-level network service device of a top level, a second-level network service device, and a third-level network service device of a bottom level, each of the third-level network service devices is communicatively connected to one of the second-level network service devices or the first-level network service devices, each of the second-level network service devices is communicatively connected to all of the first-level network service devices, and each of the first-level network service devices is communicatively connected to all of the other first-level network service devices; the device identification PID adopts an integer with a fixed length, the length is between 8 bits and 64 bits, and a rule is set for the integer, so that the hierarchy to which each network service device belongs can be deduced according to the number of the device identification PID, and the network service device of the upper stage, which is in communication connection with each three-stage network service device, can be deduced from the number of the device identification PID; reporting internal shared data to the network service devices of the upper stage step by step and distributing the internal shared data to the network service devices of the lower stage step by step, so that each network service device stores one part of the internal shared data, wherein the internal shared data comprises device identification PID and communication address information of all the network service devices; in the step S4 and the step S4a, if the service request packet is not successfully forwarded from the network service device to the other network service devices, the service request packet is forwarded through the network service device of the previous stage of the opposite party or the network service device of the previous stage of the own party.
Optionally, in the step S1, the method for establishing a direct communication connection between the network service devices includes the steps of:
s1a broadcasts and transmits the service request data packet in the network service device, wherein the service request data packet comprises the broadcasting device identifier PID_B, the network service device at the upper stage receives the service request data packet and transmits reply information, the reply information comprises a communication address of the network service device, and the network service device receives the communication address and establishes communication connection with the network service device at the upper stage.
Optionally, in the step S1, a plurality of mutually independent physical communication connection channels are established between the network service devices, so as to enhance the throughput of data forwarding.
Optionally, in the step S4 and the step S4b, one forwarding the service request packet is selected from a plurality of mutually independent physical communication connection channels between the network service devices according to the priority code included in the service request packet.
Optionally, in the step S2, a record for identifying the real NAME identifier d_name of the server in the network unit range is also registered for the network service device to which the server is communicatively connected, and a second corresponding relationship record is generated, including the real NAME identifier d_name of the server, the identifier DID of the server, and the device identifier PID of the network service device to which the server is communicatively connected, and the record of the second corresponding relationship is used as the internal shared data to report to the network service device at the upper stage step by step and distribute to the network service device at the lower stage step by step, so that each network service device stores the record of the second corresponding relationship in a second corresponding relationship registry; in the step S3, the service identifier s_info further includes a real NAME switch with bit information, and a value of one of "0" and "1" of the real NAME switch indicates that the service identifier s_info includes a real NAME identifier d_name of the service end instead of explicitly including a device identifier PID and a service end identifier DID, and in the step S4 and the step S4b, if the service identifier s_info includes the real NAME identifier d_name of the service end, the second correspondence register table is queried to find out a device identifier PID and a service end identifier DID implied by the real NAME identifier d_name of the service end.
Optionally, before the step S1, the method further includes the following steps:
s0, setting a central service system, and providing a network communication interface to provide services for the network unit;
and, in said step S1, causing said network unit to open at least one of said network service devices to the outside as an external network service device providing an external communication address w_addr to receive and transmit said service request packet and said service response packet, causing one of said external network service devices to be communicatively connected to said central service system and registering with the central service system at least one network identification NID for identifying said network unit, causing each of said external network service devices to be communicatively connected to the central service system and registering with the central service system said network identification NID and said external communication address w_addr; distributing the network identifier NID bound by the network unit and the device identifier PID of the external network service device to all the network service devices as the internal shared data and recording the internal shared data;
in the step S3, the service request packet further includes a network identifier switch for marking whether the service identifier s_info includes the network identifier NID;
In the step S4 and the step S4b, when forwarding the service request packet, if the network identifier NID is not included in the service identifier s_info, the service request packet is considered to be forwarded in the same network element, otherwise, if the network identifier NID included in the service identifier s_info is not included in the network element where the network identifier NID is included, the service request packet is forwarded to the external network service device, so that the external network service device queries the central service system to obtain the external communication address w_addr of the network element of the other party and then forwards the network element, or submits the network element to the central service system for forwarding;
in the step S5, the service response packet further includes the network identifier switch for marking whether the service identifier s_info includes the network identifier NID.
Optionally, in the step S1a, the real name of the network character string encoded by UNICODE is changed into an integer by a specific algorithm, and the fixed bit number in the real name is intercepted to obtain the network identifier NID; in the step S2, the real NAME of the server-side character string encoded by UNICODE is changed into an integer by a specific algorithm, and the fixed bit number is intercepted to obtain a real NAME identifier d_name of the server-side; in the step S3, the user identifier UID is obtained by converting the real name of the user character string encoded by UNICODE into an integer and intercepting the fixed number of bits therein by a specific algorithm.
Optionally, in the step S2, a standardized service function code fid_connect for establishing an optimized path between the client and the server is defined in the standardized service function interval.
Optionally, in the step S2, a standardized server string real name list formed by a plurality of server string real names is set, where each server string real name represents a standardized server of a specific function.
Optionally, in the step S1a, making each of the two network units that are friendly network units establish a friendly communication connection for forwarding the service request data packet and the service response data packet between the two network units by using a dedicated physical communication connection channel; distributing and recording said device identification PID of said external network service device and said network identification NID of said friendly network element related to said friendly communication connection as said internal shared data to all said network service devices; in the step S4 and the step S4b, when forwarding the service request packet, the service request packet is determined according to the network identifier NID, and if the service request packet belongs to the friendly network element, the service request packet is forwarded through the external network service device related to the friendly communication connection.
Optionally, in the step S0, the central service systems are respectively set in two or more countries or regions, and a region identifier c_code is allocated to each central service system; in said step S1a, said network identification NID contains said area identification c_code of said central service system to which said communication is connected; in the step S3, the service request packet further includes a zone switch for marking whether the network identifier NID includes the zone identifier c_code; in the step S4 and the step S4b, when the central service system is queried to obtain the external communication address w_addr of the network unit of the counterpart, if the area identifier c_code included in the network identifier NID does not belong to the home country or the area, the external communication address w_addr of the network unit of the counterpart is queried through a communication connection between the central service system of the home country or the area and the central service system including the area identifier c_code; if necessary, forwarding the service request packet using a communication connection between the central service systems; in said step S5, said service reply packet further comprises said zone switch for marking whether said network identification NID comprises said zone identification c_code.
Optionally, in the step S0, a NAT server is also set; the central service system provides a communication interface of TCPIP protocol to provide service for the network unit; in the step S1a, the TCPIP protocol is adopted for enabling the external network service device to be communicatively connected to the central service system, and the external communication address w_addr provided by the external network service device is based on the TCPIP protocol; in the step S4 and the step S4b, after the external network service device obtains the external communication address w_addr of the network element of the opposite party, if the external communication address w_addr cannot be connected in a communication manner, the external network service device is connected to one NAT server, and meanwhile, the central service system forwards a communication connection invitation data packet containing the NAT server information to the external network service device in the network element of the opposite party, so that the external network service device in the network element of the opposite party receives the communication connection invitation data packet and then connects to the same NAT server, and with the help of the NAT server, a direct TCPIP connection is established between the external network service devices of the opposite parties, and if the direct TCPIP connection cannot be successful, the service request data packet and the service response data packet are directly forwarded through the NAT server.
In a third aspect, an embodiment of the present invention discloses a network service device for network communication across communication protocol data forwarding, including a receiver, a request data processing module, and a response data processing module;
the network service devices are configured to form a network unit singly or in a plurality of the network service devices together, and in the case that a plurality of the network service devices form a network unit together, direct or indirect communication connection is established between the network service devices; each of said network service devices being assigned a device identification PID for identifying said network service device within said network element;
the receiver is configured to receive communication data from a client or a server or other network service devices, where the communication data includes a service request packet from the client and a service response packet from the server, where the service request packet and the service response packet include a service identifier s_info and a direction switch for distinguishing the service request packet from the service response packet, where the service identifier s_info includes at least one of a plurality of service function codes FID provided by the server, and also explicitly or implicitly includes the server identifier DID of the server and the device identifier PID of the network service device to which the server is connected, and the server identifier DID is used to identify the server that is communicatively connected to the network service device;
The receiver is further configured to submit the service request packet and a communication address peer_addr of a counterpart when receiving the service request packet to the request data processing module after identifying the type of the communication data according to the direction switch, and submit the service response packet to the response data processing module;
the request data processing module is used for generating a route record corresponding to the service identifier S_INFO and the peer_addr in the service request data packet, inserting or updating the route record in a return route table, and forwarding the service request data packet to the local service end according to the prompt of the service identifier S_INFO or forwarding the service request data packet to the optimal one of other connected and known network service devices so that the service request data packet is forwarded for a plurality of times and then sent to the service end;
the response data processing module is configured to search, in the return route table, for the route record that the service identifier s_info is identical to the service identifier s_info or that the service function code FID included in the service identifier s_info has an intersection with the service identifier s_info and is identical to other parts according to the service identifier s_info in the service response data packet, and forward the service response data packet to the peer_addr in the route record according to a search result.
The invention provides a network communication system, a method and a device for transmitting data across communication protocols, which are characterized by comprising the following steps:
1. scalability of
The communication capability can be provided for two independent local equipment endpoints or program endpoints, millions of equipment endpoints or program endpoints can be placed in one network unit, billions of network units can be deployed across multiple countries and regions to form a complete system, the communication capability among all endpoints in the system is realized, and the communication capability among any two endpoints is ensured.
In the first, second and third embodiments of the present invention, an independent system is implemented, and in the fourth embodiment of the present invention, an overall system is implemented in which network identifiers NID of network elements are deployed in a plurality of countries, and there are theoretically more than 1 trillion value spaces, each network element can accommodate 65535 network service devices, and theoretically more than 3 million service terminals can be accommodated below each network service device, and each network element can actually accommodate millions of service terminals.
In a typical deployment, a network element is deployed inside an enterprise, a network element is deployed inside a home, a mobile device carried by a person joins the network element inside the home at home, a company joins the network element of the company, and the mobile device alone serves as a network element elsewhere.
Scalability provides the benefit of deploying an overall network system worldwide by scaling, on the one hand, and deploying many stand-alone systems with the same software on the other hand, with the same devices.
2. Extensibility and method for making same
By defining a spare switch to add new functionality, more spare switches are extended using extended spare switches. The functions related in the invention are realized by defining the switching value, and the space for continuing to expand the functions is reserved, especially the safety can be continuously upgraded by defining the switching value later.
3. Availability of
The method provides rich functions, including that a service end realizes multicasting to a plurality of clients, communication capability is realized among devices with different communication protocols, a plurality of service ends are realized under one instruction, one instruction relates to a plurality of functions, data is sent in a plurality of data packets, user information is contained to ensure one-to-one communication, a plurality of physical communication connection channels can be expanded to improve data throughput capability, data with high instantaneity uses a special physical communication connection channel, the service end provides standardized functions, the service end defines standardized service functions by using real names of character strings of the service end, standardized service function codes FID_PING, standardized service function codes FID_CONNECT, direct communication connection is established between the real names of character strings of the service end and the real names of the character strings of the user and the real names of the character strings of the network by adopting UNICODE, and friendly network elements is assisted by a NAT server, and friendly communication connection is established between friendly network elements.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 shows a schematic system architecture of the present invention;
FIG. 2 shows a schematic diagram of the data structure of the present invention;
FIG. 3 shows a flow chart of the present invention;
fig. 4 shows a schematic structural diagram of the first and second embodiments of the present invention;
fig. 5 shows a schematic structural diagram of a third embodiment of the present invention;
fig. 6 shows a schematic diagram of a network element structure in an embodiment of the present invention;
fig. 7 shows a schematic structural diagram of a fourth embodiment of the present invention;
FIG. 8 is a schematic diagram of a data structure in an embodiment of the invention;
FIG. 9 shows a FID_CONNECT-related flowchart in accordance with an embodiment of the present invention;
Fig. 10 shows a general flow chart in an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
English abbreviations commonly used in the present invention
S_info: service identification s_info;
PID, the device identifies PID;
FID: service function code FID/first service function code FID;
DID: the service end marks DID;
UID: a user identification UID;
pid_b: the broadcaster identifies pid_b;
d_name: the real NAME of the server side marks D_NAME;
NID: network identification NID;
C_CODE: a region identification C_CODE;
fid_ping: standardized service function code fid_ping;
fid_connect: standardized service function code fid_connect;
op_code, additional function CODE;
fid_offset, the start point of the first service function code FID is deviated;
fid_num: the number of continuous service function codes FIDs;
W_ADDR-external communication address W_ADDR.
In the invention, communication and communication are distinguished, the communication only relates to an application layer in an ISO network model, and the communication only relates to other layers.
In the embodiment, the part of the digits are hexadecimal, and the beginning of the mark 0x represents hexadecimal digits.
Embodiment one:
the network communication system for data forwarding across communication protocols in the embodiment comprises a network unit, a client and a server; wherein the network element comprises a network service device;
as shown in fig. 4, a program PA is run on a computer 1 as a network service device, a program CA is run on the computer 1 as a client, and an environment control device D2 as a server; the environment control device D2 is connected to the computer 1 through a USB interface and is communicated with the program PA, the program PA opens a UDP port of a TCPIP communication protocol, the program CA is connected to the UDP port of the program PA, the UDP connection port number XXXX of the program CA is used for sending a service request data packet, the environment control device D2 is used for sending a service response data packet, the service request data packet and the service response data packet comprise a service identifier S_INFO and a direction switch for distinguishing the service request data packet and the service response data packet, the service identifier S_INFO comprises a service function code FID and also comprises a device identifier PID and a service end identifier DID, the program PA sets an integer 1 as the device identifier PID and is distributed to the environment control device D2 as the service end identifier DID, the environment control device D2 provides two service function codes FID which are an integer 0x000A and an integer 0x1000 respectively, the integer 0x000A corresponds to an online test function, and the function corresponding to the integer 0x1000 is a temperature value; and a return route table for searching a return path of the service response data packet is established and maintained in the program PA, wherein the return route table comprises records of the corresponding relation between the service identifier S_INFO and the peer communication address peer_addr when the service request data packet is received.
The data length definition of this embodiment can be referred to fig. 8.
The program CA provides an interface for querying the environment control device D2 for the temperature, and if the query is clicked, a service request packet is sent to the program PA, where the data format is shown in table 1, and pid=0x0001 and did=0x0002 form the first addressing information, pid=0x0001 represents the program PA, and did=0x0002 points to the environment control device D2.
TABLE 1
The program PA receives the data, judges the data packet belonging to the service request through a direction switch, and inserts or updates a route record in a return route table: the service identity s_info (pid=0x0001, did=0x0002, fid=0x1000), peer_addr (pro col=udp, port=xxxx), is determined to be directed to the locally connected climate control device D2 by the first addressing information, so the data is forwarded to the climate control device D2 by USB.
The format of the service response packet returned by the environmental control device D2 is shown in table 2, and has the same service identifier s_info as the service request packet, the direction switch is reversed, and the first correspondence relationship is established between the service response packet and the service request packet by using the same service identifier s_info as a link.
In the following examples, another situation of the first correspondence may be demonstrated, that is, the service response packet and the service request packet have an FID intersection, and the rest of service identifiers s_info are the same, and in summary, the service response packet and the service request packet establish the first correspondence for the link through the service identifiers s_info.
TABLE 2
The program PA receives the above data, determines, by means of the direction switch, that the packet belongs to the service response packet, finds, in the return route table, a route record of the service request packet according to the service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000), wherein procol=udp, port=xxxx, and forwards the service response packet to the PORT XXXX by means of the UDP PROTOCOL.
The program CA receives the service response packet, and reads the temperature value 25 and displays it on the interface at 25 ℃.
The communication principle of the embodiment is that a client and a server are respectively in communication connection with a network service device, the network service devices are in direct or indirect communication connection, a service identifier S_INFO in a service request data packet sent to the server by the network service device comprises first addressing information of the server and at least one of a plurality of service function codes FID provided in the server, the single or the plurality of network service devices forward the service request data packet to the server for the client, the network service device addresses and forwards the service request data packet according to the first addressing information on one hand, records a path sent by the service request data packet by using the service identifier S_INFO as a keyword on the other hand, a service response data packet responded by the server and the service request data packet establish a first corresponding relation according to the service identifier S_INFO, and the network service device searches a path of the corresponding service request data packet for the service response data packet for returning the service response data packet to the client through the first corresponding relation.
The network communication method for data forwarding across communication protocols of the embodiment comprises the following steps:
s1, running a program PA on a computer 1 as a network service device, forming a network unit of a single network service device, and setting an integer 1 as a device identification PID;
s2, the environment control device D2 is used as a service end to provide two service function codes FID, wherein the service function codes FID are an integer 0x000A and an integer 0x1000 respectively, the integer 0x000A corresponds to an online test function, the function corresponding to the integer 0x1000 is a temperature value, the environment control device D2 is accessed into the computer 1 through a USB interface and is in communication connection with the program PA, and the integer 2 distributed to the environment control device D2 is used as a service end identifier DID;
s3, the program CA running on the computer 1 is connected to the UDP port of the program PA as a client, and after inputting the query command, a service request packet is sent to the program PA, where the service request packet includes a service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000), and the direction switch is 0, where pid=0x0001 and did=0x0002 constitute the first addressing information;
s4, the program PA receives the data, judges the data packet belonging to the service request through a direction switch, and inserts or updates a record in a return route table: service identity s_info (pid=0x0001, did=0x0002, fid=0x1000), procol=udp, port=xxxx, determining from the first addressing information (pid=0x0001, did=0x0002) that it is directed to the environmental control device D2 of the communication connection under the present network service apparatus, forwarding the data to the environmental control device D2 via USB;
The S5 environment control equipment D2 receives the service request data packet, returns a service response data packet, comprises a service identifier S_INFO (PID=0x0001, DID=0x0002 and FID=0x1000), has a direction switch of 1, and establishes a first corresponding relation with the same service identifier S_INFO;
s6, the program PA receives the data returned by the environment control device D2, judges the data belongs to the service response data packet through a direction switch, finds a route record of the service request data packet by the same service identifier S_INFO (PID=0x0001, DID=0x0002 and FID=0x1000) in a return route table according to a first corresponding relation, wherein PROTOCOL=UDP, PORT=XXXX and forwards the service response data packet to a PORT XXXX through a UDP PROTOCOL;
s7, the program CA receives the service response data packet.
Embodiment two:
the network communication system for data forwarding across communication protocols of the present embodiment adds a client and a server based on the first embodiment.
The service request packet and the service reply packet add data length information and additional function codes for additional definition of the service function code FID. Each record in the return route table is added with a timing identifier, and the timing identifier is updated when the service identifier S_INFO and the peer communication address peer_addr record are inserted and updated. The service request data packet and the service response data packet are respectively provided with a plurality of switching values: the 2 nd bit of the switching value is a multifunctional switch, the 3 rd bit is a user switch, the 4 th bit is a priority switch, the 5 th bit is a delete switch, the 6 th bit is a single switch, and the 7 th bit is a serial number switch.
Since USB communication can distinguish packet boundaries by using time intervals of a pause in data transmission, and UDP protocol itself is transmitted in units of packets, service request packets and service response packets do not exceed the packet byte count limit specified by UDP protocol, data length information may not be used in the first embodiment, but for a communication protocol of streaming data such as TCP protocol, it is necessary to determine packet boundaries in streaming data to extract data length information of the packets.
The additional function CODE increases the flexibility of use, e.g. op_code=0x01 can be defined as read, op_code=0x02 as continuous read, op_code=0x03 as write.
When the multifunction switch is "1", the service identifier s_info contains a plurality of service function codes FID, and a plurality of functions provided by the service end can be operated at a time, which is usually used for reading or writing a plurality of continuous fixed-length values. In order to prevent abuse of the multifunctional read-write capability, corresponding rules are formulated as follows:
under the condition that the service end definitely designates not more than 255 continuous service function codes FIDs as the multifunctional areas, the client end can set the multifunctional switch to be 1 to access the designated multifunctional areas. The first service function code FID of each multi-function area is the first service function code FID, and each multi-function area has only one first service function code FID. Each service function code FID in the multifunction area is individually accessible as other service function codes FID of the non-multifunction area.
The method for accessing the plurality of service function codes FID in the area is as follows: the multifunctional switch is set at "1", the service identifier s_info further includes multifunctional code data, the first service function code FID is filled in the position of the service function code FID in the service identifier s_info, the position of the multifunctional code data is divided into two parts, the first 8 bits are the number of the consecutive service function codes FID deviating from the start point of the first service function code FID.
In the case that the service identifier s_info contains a plurality of service function codes FID, the first correspondence established between the service response packet and the service request packet according to the service identifier s_info includes two cases: one is that the service request packet and the service response packet have the same service identity s_info, and the other is that the service request packet and the service response packet have the service identity s_info with the service function code FID intersecting and the other part being the same.
If there is only one service function code FID in the service identifier s_info, the first correspondence is only one case, and the service response packet is identical to the service identifier s_info of the service request packet.
Setting the first service function code FID facilitates faster calculation of the first correspondence by the network service device.
Program PA sets the lifetime recorded in the return route table to 1 minute.
The data length definition of this embodiment can be referred to fig. 8.
As shown in fig. 4, the added service end in the embodiment is an environmental control device D3 with the same structure and function as the environmental control device D2, and is also connected to the computer 1 through a USB interface and communicates with the program PA; an integer 3 allocated to the environment control device D3 is used as a service end identifier DID;
the network service devices themselves also have the attribute of the service terminals, the program PA also assigns an integer 0 to itself as the service terminal identification DID, and each network service device uses the integer 0 as its own service terminal identification DID. Each network service device has two device identification PIDs, one being the device identification PID that is unique within the network element and used as an identity, and the other being the broadcast device identification pid_b, with the integer 0 as a particular device identification PID.
The program PA provides two service function codes FID, wherein the service function codes FID are respectively an integer of 0x000A corresponding to an online test function and an integer of 0x1008 corresponding to a client connection request function; the environment control device D2 and the environment control device D3 add five service function codes FID, which are respectively an integer of 0x1001 corresponding to the temperature of fahrenheit, an integer of 0x1002 corresponding to the humidity, an integer of 0x1100 corresponding to the temperature history, an integer of 0x1102 corresponding to the humidity history, and an integer of 0x2000 corresponding to the dehumidification function, wherein 0x1000 to 0x1002 are a multi-function area, and 0x1000 is the first service function code FID.
One added client is a program CB running on computer 2, computer 2 being located in the same network segment of the same local area network as computer 1.
Client registration
In order to connect the program PA, the program CB transmits a broadcast packet in accordance with the format of the service request packet by UDP, the data format is shown in table 3, wherein the data length information is 2 bytes, the value of which is 0x0009 indicates that the remaining part is 9 bytes, including switching value of 2 bytes, service identifier s_info of 6 bytes (pid=0x0000, did=0x0000, fid=0x1008), and additional function code of 1 byte.
TABLE 3 Table 3
The program PA receives the above data, confirms that the data belongs to a special service request packet by a service identifier s_info (pid=0x0000, did=0x0000, fid=0x1008), wherein pid=0x0000 is a broadcaster identifier pid_b, the function represented by fid=0x1008 is a connection request of a client, did=0x0000 is a corresponding program PA itself, and the network service device does not forward the service request packet with PID identifier pid_b, and the program PA sends back its UDP communication address information to the peer receiving the broadcast packet, so that the program CB obtains the communication address of the program PA and establishes a communication connection with the program PA.
Communication process between client and server
The following procedure is substantially the same as the procedure CA for inquiring the temperature in the first embodiment, and only the differences are shown below, and the specific procedure is explained in the first embodiment.
The data format of program CA query temperature is shown in Table 4, and compared with Table 1, the data length information is increased and the switching value is changed, and the rest data are identical. The data length information in table 4 is shown as 9 bytes, and does not include 2 bytes occupied by itself. The switching value 0x0400 represents that the single switch has been turned on, and its function will be revealed later.
TABLE 4 Table 4
After the program PA inserts and updates the route record in the return route table, the timing identifier is updated in the route record, and the current time is recorded.
TABLE 5
The data format returned by the environment control device D2 is shown in table 5, and compared with table 2, the data length is increased, the single switch value in the switching value is different, and the rest parts are identical.
Rule one for deleting return route table
The function of the single switch is shown next. The switching value 0x8400 in table 5, where the 6 th switching value is 1, represents that the single switching function is turned on. After completing the return transfer of the service response packet, the program PA deletes the route record having the same service identifier s_info from the return route table, based on the service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000) because the single switching function is turned on. The single switch can only be adapted to the situation where the service identification s_info in the first correspondence is exactly the same.
One instruction is sent to a plurality of service ends
The program CA sends a service request packet for performing the dehumidification function to the program PA in a data format shown in table 6, where did=0x7fff is the maximum value of DID, and represents all the service terminals communicatively connected to the same network service device. Pid=0x0001 represents procedure PA, fid=0x2000 represents dehumidification function.
TABLE 6
Since did=0x7fff is defined as all the service terminals to which the program PA communicates, the program PA forwards the above service request packet to the environment control device D2 and the environment control device D3 while also inserting or updating the following route records in the route table: service identifier s_info (pid=0x0001, did=0x7fff, fid=0x2000), peer_addr (procol=udp, port=xxxx), timing identifier=yyyyyyyyyyyyy.
The environmental control device D2 and the environmental control device D3 perform the function of fid=0x2000, simultaneously start the dehumidification function, and respectively transmit service response packets of the same format, and the returned service response packets are different from the service request packets shown in table 6, except that the switching value of 0x8000 represents that the packets are service response packets, and the rest are identical.
After the program PA receives two identical service response data packets, and determines the categories of the two identical service response data packets according to the direction switches, according to the first corresponding relation, the program PA finds the route records with identical service identifiers s_info (pid=0x0001, did=0x7fff, fid=0x2000) in the return route table, wherein the peer_addr (pro col=udp, port=xxxx), and forwards the service response data packets to the PORT XXXX through the UDP PROTOCOL.
The program CA receives the two service response packets and confirms that the two devices perform the dehumidification function.
Except that did=0x7fff represents all servers, the method for representing multiple servers is as follows:
on the premise that the number of all service ends which are communicated and connected by the limiting program PA is not more than 125, the DID value is not more than 126, a certain integer is calculated to represent a plurality of service ends through a formula, and if the first is DID1 and N continuous numbers are used, the formula DID1 is calculated to represent N continuous numbered service ends starting from the DID 1. For example: did=514, 514=2×256+2, representing 2 servers starting from did=2, did=2 and did=3, respectively, and then did=514 includes an environment control device D2 and an environment control device D3.
Rule II for deleting return route table
After the environment control device D2 executes the instruction of the dehumidification function, it sends an instruction for deleting the route record in the return route table, the data format is shown in table 7, and is also a service response data packet, the switching value 0x8800 represents that the 5 th switching value delete switch is "1", and the service response data packet is displayed as a delete instruction.
TABLE 7
The program PA receives the service response packet, first determines the type of the data according to the direction switch, then determines the delete switch to be "1", executes the delete instruction, and deletes the route record of the service identifier s_info identical in the return route table according to the service identifier s_info (pid=0x0001, did=0x7fff, fid=0x2000). The delete switch is only applicable in the case where the service identification s_info in the first correspondence is exactly the same.
Rule III for deleting return route table
If the program PA does not send the instruction for deleting the route record in the return route table, the program CA does not send the same service request packet for executing the dehumidification function any more, and after 1 minute is reached, the program PA judges and deletes the route record exceeding 1 minute according to the timing mark when traversing the route record in the return route table, and the following route record is deleted: service identifier s_info (pid=0x0001, did=0x7fff, fid=0x2000), peer_addr (procol=udp, port=xxxx), timing identifier=yyyyyyyyyyyyy. The route records the service request packet of the dehumidification function sent by the corresponding program CA.
An instruction comprises a plurality of continuous service function codes FIDs
The program CB needs to keep real-time monitoring of the temperature and humidity of the environment control device D2, transmit the service request packet as shown in table 8 to the program PA as the network service means, and repeatedly transmit the service request packet every 50 seconds.
TABLE 8
The multifunction switch is "1", the service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000, fid_offset=0x00, fid_num=0x03) further includes a first service function code FID and multifunction code data, the multifunction code data represents 3 consecutive service function codes FID with the first service function code fid=0x1000 as a reference point, and the number fid_num=0x03 of consecutive service function codes FID is respectively 0x1000, 0x1001 of fahrenheit, and 0x1002 of humidity from the start point fid_offset=0x00 of the first service function code FID.
The program PA forwards the service request packet to the environment control device D2 according to the first addressing information (pid=0x0001, did=0x0002), and the program PA also creates a routing record in the return routing table for the service request packet. The environment control device D2 receives the data, sends service response data as shown in table 9, and sends the service response data in the same service identifier s_info according to the format shown in table 9 immediately after the client does not need to send the service request data packet again if there is a change in the data according to the continuous read instruction prompted by the additional function CODE op_code=0x02.
TABLE 9
When the service response data packet passes through the program PA, a return route table is searched according to the first corresponding relation, a route record of the service request data packet containing the same service identifier s_info is found, the service request data packet is forwarded to the program CB according to the peer_addr in the route record, the program CB reads the temperature value of the environment control device D2 to be 0x19, the temperature value of the fahrenheit to be 0x4D and the humidity value to be 0x20.
Service response data packet returns to multiple clients
If program CB is maintaining real-time monitoring to environment control device D2, program CA sends a service request packet of temperature query as shown in table 4, and after program PA forwards the service request packet, there are at least two routing records in the return routing table, routing record 1: service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000), peer_addr (procol=udp, port=xxxx), timing identifier=yyyyyyyyyy 1; route record 2: service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000, fid_offset=0x00, fid_num=0x03), peer_addr (procol=udp, port=xxxx2), timing identifier=yyyyyy2; where port=xxxx is the UDP PORT number of program CA and port=xxxx2 is the UDP PORT number of program CB.
The environment control device D2 returns a service response packet as shown in table 5, the program PA searches the return route table according to the service identifier s_info (pid=0x0001, did=0x0002, fid=0x1000), and of the two route records, the service identifier s_info of the route record 1 is identical to the service identifier s_info, whereas the service identifier s_info of the route record 2 includes the same service function code FID (fid=0x1000), and other portions pid=0x0001, did=0x0002 are identical to each other, so as to conform to the first correspondence. The two routing records conform to the first corresponding relation, and the service response data packet is forwarded twice and respectively forwarded to the program CA and the program CB.
User identification, packet sequence number and priority code
The program CA needs to download the historical humidity information in the environment control device D2, uses the function of fid=0x1102, sets parameters as a record of reading 3000 (0x0bb8), marks the user switch as "1" in order to ensure one-to-one data transmission, the service identifier s_info further includes the user identifier UID, obtains the service identifier s_info (pid=0x0001, did=0x0002, fid=0x1102, uid=0x 1122334455), sets the priority code of the downloaded data as 0x20 in order not to affect normal data monitoring, is lower than the priority of general data transmission, and the program CA transmits data as shown in table 10, and the switching value 0x3000 represents that the 3 rd and 4 th switching values are both "1", which are the user switch and the priority switch, respectively. The priority switch is "1", and then 1 byte immediately following the switching amount is the priority code.
Table 10
The program PA forwards the service request packet to the environment control device D2 according to the first addressing information (pid=0x0001, did=0x0002), and establishes a route record in the return route table, where the environment control device D2 sends 300 records each time as service response packets in 10 times, the data format is shown in table 11, the switching value 0xB200 represents that the 1 st, 3 rd, 4 th and 7 th switches are "1", the 7 th switch represents a sequence number switch, and when the sequence number switch is "1", the data contains a packet sequence number of 4 bytes. Packet number=0x00000001 represents the 1 st packet of 10, and after each transmission of data, if there is other data to be transmitted, the other data is preferentially transmitted.
TABLE 11
Program PA searches the return route table based on service id s_info (pid=0x0001, did=0x0002, fid=0x1102, uid=0x 1122334455), and returns 10 service response packets to program CA based on the peer_addr in the route record.
Embodiment III:
as shown in fig. 5, in the network communication system for data forwarding across communication protocols according to the present embodiment, a plurality of network service devices are added to form a network unit with a three-layer structure based on the second embodiment. A visual manipulator is additionally arranged on the computer 1, the program PA opens a TCP port of a TCPIP communication protocol, the visual manipulator is connected to the TCP port of the program PA through communication, and an integer 4 is obtained and used as a service end identifier DID; the visual manipulator provides 4 service function codes FID, which are respectively corresponding to an online test function by an integer of 0x000A, a communication connection test function by an integer of 0x000B, an action control function by an integer of 0x1001 and a video stream by an integer of 0x 2000.
The network service devices in the network unit are divided into three layers, including a first-stage network service device at the uppermost stage, a second-stage network service device and a third-stage network service device at the lowermost stage, each third-stage network service device is communicatively connected to one second-stage network service device or one first-stage network service device, each second-stage network service device is communicatively connected to all first-stage network service devices, and each first-stage network service device is communicatively connected to all other first-stage network service devices; the device identification PID adopts an integer with fixed 16 bit length, and a rule set for the integer enables the hierarchy of each network service device to be deduced according to the number of the device identification PID, and the network service device of the upper stage connected by each three-stage network service device in communication to be deduced according to the number of the device identification PID; each network service device needs to store one internal shared data, and reports the internal shared data to the network service device of the upper stage step by step and distributes the internal shared data to the network service device of the lower stage step by step, so that each network service device stores one internal shared data, and the internal shared data comprises device identification PID and communication address information of all the network service devices.
The network service device added on the basis of the second embodiment of the present invention includes a primary network service device, two secondary network service devices, and two tertiary network service devices.
In this embodiment, a server side real NAME identifier d_name for identifying the server side within the range of the network element is also allocated to the server side, and each server side real NAME identifier d_name and a device identifier PID of a network service device to which the server side is communicatively connected and a server side identifier DID of the server side form a second corresponding relationship, and a record of the second corresponding relationship is distributed as internal shared data to each network service device;
in this embodiment, the service identifier s_info further includes a real-NAME switch with bit information, where a real-NAME switch of "1" indicates that the service identifier s_info includes a service-side real-NAME identifier d_name, and a real-NAME switch of "0" indicates that the service identifier s_info explicitly includes a device identifier PID and a service-side identifier DID. The service end identification DID has 15 bits in length, the device identification PID has 16 bits, the real name switch and the service end identification DID form 16 bits together, and the maximum value of the service end identification DID is 0x7FFF. The server real NAME identifier d_name has a length of 31 bits. Either the real NAME switch and the server side real NAME identification d_name are 32 bits together, or the real NAME switch and the server side identification DID and the device identification PID are 32 bits together.
The data length definition of this embodiment can be referred to fig. 8.
Device identification PID numbering rules
Integer 1 is used as a primary network service device, integers 2-127 are used for a tertiary network service device and are communicatively connected to the primary network service device with PID value 1, integers which can be divided by 128 are used for a secondary network service device from 128 to 65471, the device identification PID of the tertiary network service device is larger than the device identification PID of the secondary network service device to which the tertiary network service device is communicatively connected, and the difference is smaller than 128, and 65472-65535 total 64 integers are used for the primary network service device; if only a single network service device exists in the network unit, the device identifier PID is 1, and the small network unit can not be provided with a secondary network service device;
according to the numbering rule, as shown in fig. 5, all network service devices are connected by TCPIP protocol, each network service device uses integer 0 as service end identifier DID, uses integer 0 as broadcasting device identifier pid_b, provides 5 service function codes FID, which are respectively an integer 0x000A corresponding to an online test function, an integer 0x000B corresponding to a communication connection test function, an integer 0x1007 corresponding to a network service device connection request function, an integer 0x1008 corresponding to a client connection request function, and an integer 0x1009 corresponding to a service end connection request function.
Structure of network element
As shown in fig. 6, the network element structure may be one of three cases, the minimum network element has only one network service device, which is suitable for networking of hundreds of device endpoints and program endpoints, the double-layer network element forms a medium-sized and small-sized network element, which is suitable for networking of thousands of device endpoints and program endpoints, and the three-layer network element forms a large-sized network element, which is suitable for networking of millions of device endpoints and program endpoints. The network element structure of this embodiment is shown in fig. 5, and a three-layer network element structure is adopted.
Network service device registration and client registration
As shown in fig. 5, the computer 1 in the second embodiment is placed in the present network unit, the program PA is started, the program PA sends out a broadcast packet of UDP protocol, the broadcast packet conforms to the format of the service request packet, and includes a service identifier s_info (pid=0x0000, real name switch+did=0x0000, fid=0x1007), since the secondary network service device of pid=256 is in the same lan as the computer 1, the broadcast packet is received, the return information includes a communication address and a device identifier PID, the program PA is communicatively connected to the communication address, sends out the service request packet with the service identifier s_info (pid=256, real name switch+did=0, fid=0x1007), performs data exchange with the network service device of pid=256, and registers as a tertiary network service device, so as to obtain pid=257; if the program PA sends out the broadcast packet without being responded, as in the second embodiment, the program PA is customized as the primary network service device and uses the integer 1 as its own device identifier PID.
The communication connection between the network service device and the previous network service device is established in a manner that is different from the automatic manner described above, the communication address of the previous network service device may be manually set, and if it is desired to connect the first network service device with the identity of the second network service device, a role may be set so as to assign the device identification PID of the second network service device, and if the role is not specified, the device identification PID of the third network service device may be uniformly assigned. The tertiary network service device cannot assign device identification PIDs to other network service devices.
In the case where the communication address of the upper network service device is known, the device identification PID thereof is not known, a communication connection is established with the communication address and a service request packet is issued thereto, including the service identification s_info (pid=0x0000, real name switch+did=0x0000, fid=0x1007), the upper network service device return information includes the communication address and the device identification PID, and the service request packet is issued again based on the returned device identification PID, including the service identification s_info (pid=returned PID, real name switch+did=0x0000, fid=0x1007), and the upper network service device allocates the device identification PID to the connected network service device according to fid=0x1007.
As shown in fig. 5, in this embodiment, the computer 2 is located in a location not in the same network segment of the same lan as the computer 1, and the program CB in the computer 2 finds the three-level network service device with pid=129 through the procedure of client registration described in the second embodiment and establishes a communication connection with the network service device.
Multiple network service device multiple forwarding
As shown in fig. 5, the program CB on the computer 2 needs to monitor the environmental control device D2, in order to ensure reliability, the program CB adopts the TCP protocol in the whole process, and sends a service request packet to the network service device of pid=129, where the service request packet is targeted at the environmental control device D2 of did=2 under pid=257, and the first addressing information (pid=0x0101, real-name switch+did=0x0002) corresponds to the environmental control device D2 as shown in table 12.
Table 12
The tertiary network service device of pid=129 receives the service request data packet, and takes into consideration direct communication connection and forwarding with the program PA of the target pid=257 in the first addressing information, takes into consideration communication connection and forwarding with the secondary network service device of the previous stage pid=256 of the target pid=257, and takes into consideration forwarding to the secondary network service device of the previous stage pid=128 of the secondary network service device;
If the secondary network service device with pid=128 receives the service request packet, it takes precedence to directly connect and forward program PA with the target pid=257 in the first addressing information, takes precedence to connect and forward the secondary network service device with the previous pid=256 with the target pid=257, and takes precedence to forward the primary network service device with the previous pid=1.
The service request packet shown in table 12 arrives at the environmental control device D2 after at most 5 forwarding, and the specific path is: (pid=129) → (pid=128) → (pid=1) → (pid=256) → (pid=257) →the environmental control device D2.
Because each forwarding is performed, the routing record is updated in the return route table, and the service response data packet replied by the environment control device D2 reversely returns to the program CB according to the path recorded by each forwarding route record. For a specific procedure, reference may be made to the procedure of returning the service response packet in the first and second embodiments, or to the flow shown in fig. 10.
Each network service device records the communication addresses of all other network service devices, when the network unit is set, the communication addresses between every two network service devices can be directly connected as far as possible, so that the service request data packet shown in table 12 reaches the environment control device D2 after 2 times of forwarding, and the specific path is: (pid=129) → (pid=257) →the environmental control device D2.
Establishing multiple physical communication connection channels between network service devices
The network unit is built in a local area network, which is called a main local area network, each network service device is a node of the main local area network, an IP address of the main local area network is allocated, and the communication connection of TCPIP can be directly built between every two network service devices by utilizing the communication capability in the main local area network. Based on the above configuration, further communication capabilities may be added to increase the data throughput capacity within the network element in addition to the communication capabilities of the primary lan. The network service devices are connected again through another independent local area network, and a plurality of communication connections can be established between the network service devices through different physical communication connection channels. As shown in fig. 5, an optical fiber dedicated line is set up between the network service device with pid=129 and the network service device with pid=257, an ethernet direct connection line without passing through a switch is set up by using an optical fiber, two sides each use an optical transceiver module for converting an optical fiber into 1000M ethernet, two network service devices on two sides are respectively provided with two 1000M network ports, one 1000M network port is connected to the main lan, and the other 1000M network port is connected to the optical transceiver module. For any one of the network service apparatus of pid=129 and the network service apparatus of pid=257, two IP addresses are allocated to the two network ports, and the two IP addresses do not belong to the same network segment, so that no collision occurs. The network service device of pid=129 and the network service device of pid=257 each record two communication addresses of TCP on each other, where the two communication addresses of TCP represent two independent physical communication connection channels, and one of them passes through the main lan and the other passes through the optical fiber dedicated line, and when forwarding the service request packet using the TCP protocol, any one of the communication addresses may be selected, or any one of the physical communication connection channels may be selected for forwarding.
Data use dedicated physical communication connection channel with high real-time performance
In order to remotely control the operation of the visualization manipulator from the program CB, it is necessary to ensure better real-time performance, and before, an optical fiber dedicated line has been set up between the network service device with pid=129 and the network service device with pid=257, and delay of the ethernet is usually caused by network congestion, so it is important to control the bandwidth utilization rate of the optical fiber dedicated line, and to keep the data transmission rate on the optical fiber dedicated line not to exceed a certain upper limit value. The special light line is set to only transmit the service request data packet with specific priority code, and other service request data packets select the communication address of the main local area network for transmission. The program CB sends a service request data packet to the visual manipulator, a network service device with a high priority and a priority code of 0x01 and PID=129 is used for forwarding the received service request data packet by selecting an optical fiber private line only when the priority code is 0x01, so that the real-time performance of the program CB in remote control and operation of the visual manipulator is ensured.
Basic number of bytes
As shown in fig. 8, the most basic data included in the service request packet and the service response packet include: the data length information, the switching value, the real NAME switch, the server real NAME identifier d_name (or alternatively, the server identifier DID and the device identifier PID), the service function code FID (or the first service function code FID) and the additional function code all have fixed lengths, and the length added together is 11 bytes, so the number of basic bytes of the service request packet and the service response packet is 11 bytes. The minimum value of the data length information is 0x0009.
FID_PING
The service function code FID is set as an integer of 2 bytes, a standardized service function interval and a custom service function interval are divided according to the value interval of the integer, and the function definition of the service function code FID with the value falling in the standardized service function interval is standardized. In the embodiment, each server includes a network service device and has an fid=0x000a corresponding to an online test function for testing whether the server is online, where the fid=0x000a belongs to the standardized service function section and is defined as a standardized service function code fid_ping, abbreviated as fid_ping.
For any service end, including network service device, the service request data packet containing FID_PING can be used to test whether the opposite party is online, if the replied service response data packet is obtained, the service end is proved to be online and work normally.
Service side real NAME identification D_NAME:
in order to operate the visual manipulator, the service request data packet may be sent by using the service end real NAME identifier d_name instead of the device identifier PID and the service end identifier DID, where the service end real NAME identifier d_name and the real NAME switch of the visual manipulator together form a 32-bit integer, the decimal written 2779839086, hexadecimal 0xA5B0FA6E, and the integer is greater than 21474883648 (0 x 80000000), where the real NAME switch is "1".
The program CB sends a service request packet with fid_ping function to the visualization robot, the data format of which is shown in table 13, and includes a service identifier s_info (real NAME switch+d_name=0xa5b0fa E, FID =0x000a).
TABLE 13
The three-level network service device with PID=129 receives the service request data packet, establishes a route record in a return route table by taking a service identifier S_INFO (real NAME switch+D_NAME=0xA5B0FA E, FID =0x000A) as a key word, searches a second corresponding relation register table in stored internal shared data, finds out the hidden PID=257 of the D_NAME, and selects a communication connection established between the network service device with PID=129 and the network service device with PID=257 through an optical fiber private line to forward the service request data packet to the network service device with PID=257 according to a priority code 0x 01; the network service device of pid=257 receives the service request packet, establishes a routing record in a return routing table by taking a service identifier s_info (real NAME switch+d_name=0xa 5B0 fa6fa E, FID =0x000a) as a keyword, searches a second corresponding relation registration table in stored internal shared data, finds pid=257 and did=4 implied by d_name, and then forwards the service request packet to the visual manipulator represented by did=4; the service response packet returned by the visualization robot also includes the service identifier s_info (real NAME switch+d_name=0xa5b0fa E, FID =0x000a), and returns to the program CB in the reverse direction according to the above path.
Embodiment four:
as shown in fig. 7, the network communication system for data forwarding across communication protocols according to the present embodiment adds a central service system based on the third embodiment. Each central service system polices at least two network elements, each network element being assigned at least one network identification NID for identifying network elements within the network communication system; each network unit opens at least one network service device to the outside as an external network service device for providing an external communication address w_addr to receive and send service request data packets and service response data packets, and the external network service device is also used for being in communication connection with a central service system; the internal shared data also comprises a network identifier NID of the network element and a device identifier PID of the external network service device; the central service system is used for forwarding service request data packets and service response data packets between two network units, and is also used for registering and inquiring network identifications NID and external communication addresses W_ADDR of the network units; the service request data packet and the service response data packet also comprise a network identification switch for marking whether the service identification S_INFO comprises a network identification NID, wherein the service identification S_INFO does not comprise the network identification NID and indicates that communication only occurs in the same network unit, otherwise, if the network identification NID contained in the service identification S_INFO does not belong to the network unit where the service identification S_INFO belongs, the service request data packet and the service response data packet are forwarded between the two network units, and an external network service device inquires a central service system to obtain an external communication address W_ADDR of a counterpart network unit and then establishes communication connection between the two network units for forwarding, or submits the communication connection to the central service system for forwarding; the external network service device is typically a primary network service device.
Setting central service systems in at least two countries or regions, and distributing region identification C_CODE to each central service system, wherein each central service system is at least in communication connection with two network units, communication connection is established between any two central service systems, and the central service systems are used for mutually inquiring external communication addresses W_ADDR of network units in the range of the other side and forwarding service request data packets and service response data packets; the service request packet and the service response packet further comprise a zone switch with bit information, and when the zone switch is "1", the network identifier NID comprises a zone identifier c_code of the central service system to which the corresponding network element is communicatively connected.
The network unit and the central service system establish communication connection by adopting a TCPIP protocol, the central service system also comprises an NAT server, the two network units are connected to the NAT server by adopting the TCPIP protocol, and the direct communication connection between the two network units is realized by the help of the NAT server, or the service request data packet and the service response data packet between the two network units are directly forwarded by the NAT server.
The definition of the data structure of this embodiment can refer to fig. 8, and this embodiment implements all the data in fig. 8.
Real name of network character string, real name of server character string and real name of user character string
In order to facilitate the data processing of the computer, the network identifier NID, the server real NAME identifier d_name and the user identifier UID are all fixed in length, and the network character string real NAME, the server character string real NAME and the user character string real NAME respectively corresponding to the network identifier NID, the server real NAME and the user character string real NAME are character strings with inconsistent lengths, which are convenient for human identification, and a conversion is needed between the network identifier NID, the server real NAME identifier d_name and the user identifier UID. The method adopted is as follows:
for the real name of the network character string, firstly, the network character string is made to be a character string of UNICODE, so that the network character string can be compatible with characters of most countries in the world, the UNICODE character string is converted into UTF-8 codes, CRC32 operation is carried out on the UTF-8 codes to obtain values with the length of 4 bytes, CRC16 operation is carried out on the UTF-8 codes to obtain values with the length of 2 bytes, and 1 byte in the values is taken together with 4 bytes obtained by CRC32 to form a network identifier NID with the fixed length of 40 bits. For example, "Gaokou agricultural company" is a real name of a network character string, which is converted into 5 bytes, namely 0x77, 0xEC, 0x73, 0x18 and 0x84 respectively.
For the real NAME of the server-side character string, firstly, the character string is made to be a UNICODE character string which can be compatible with characters of most countries in the world, the UNICODE character string is converted into UTF-8 codes, CRC32 operation is carried out on the UTF-8 codes to obtain a 32-bit integer, if the integer is smaller than hexadecimal 0x80000000, the integer is added with 0x80000000, the obtained integer forms an integer which is larger than 0x80000000, a real NAME switch is represented as '1', and the rest is 31-bit server-side real NAME identification D_NAME. For example: the visual manipulator is a real name of a server-side character string, and the real name is converted into a 32-bit integer 2779839086, wherein the real name switch is contained as 1.
For the real name of the user character string, firstly, the user character string is made to be a character string of UNICODE, so that the user character string can be compatible with characters of most countries in the world, the UNICODE character string is converted into UTF-8 codes, CRC32 operation is conducted on the UTF-8 codes to obtain values with the length of 4 bytes, CRC16 operation is conducted on the UTF-8 codes to obtain values with the length of 2 bytes, and 1 byte in the values is taken together with 4 bytes obtained by CRC32 to form a 40-bit user identification UID with the fixed length. For example, "598770791@qq.com" is the real name of the user string, converted into 5 bytes, 0xCC, 0x59, 0x76, 0xAD, 0x33, respectively.
Service end with standardized function defined by real name of service end character string
After a client or a server joins a network element, if the functions and the first addressing information of other servers in the network element are not known, the client or the server cannot work cooperatively with other servers, and manual configuration is required. In order to enable a client or a server to automatically put into operation once joining a network element, a server running a standardized function in the network element is provided with a real NAME of a server character string, the client or the server uses the real NAME of the server character string to be converted into a real NAME identifier D_NAME through CRC32 to access the server of the standardized function, and the standardized server assists the client or the server to enter a working state.
For example, a server with standardized function, in which the real name of the server string is "storage allocator", is designed, and is converted into a 32-bit integer 2168101881, where the real name switch is "1". Once a client or other service end joins in a network unit, the client or other service end first accesses the storage distributor, does not need to know the service end identifier DID and the device identifier PID, and can access the network unit only by converting the service end identifier into the service end real NAME identifier D_NAME through the real NAME of the service end character string, the client or other service end can obtain the storage address of the configuration information and the storage address of the operation data from the storage distributor, the client or other service end can obtain the configuration information from the storage address of the configuration information, perform self configuration to enter a normal operation state, and operate the generated data, and save the generated data according to the storage address of the operation data distributed by the storage distributor.
FID_CONNECT
In addition to fid_ping, a standardized service function code fid_connect for establishing an optimized path between the client and the server is defined in the standardized service function interval. The network service device receives the service request data packet, and sometimes needs to establish a new communication connection for forwarding the service request data packet before forwarding, and needs to wait for a period of time to establish the new communication connection, wherein the service request data packet in the waiting time is either buffered or discarded, and the use of fid_connect avoids the two situations of buffering data or discarding data. Fid_connect is defined as 0x000B. If multiple data traffic is needed between the client and the server, a service request data packet containing the service function code FID as fid_connect is sent first, then other service request data packets are stopped from being sent until a service response data packet containing fid_connect is received, which indicates that the optimized path is ready, and communication connection on the whole path is established, at this time, the service request data packet sent to the server can be directly forwarded along the optimized path, and network service devices along the path do not need to buffer the service request data packet. The network service device attempts to establish an optimized path only for the service request packet containing the service function code FID fid_connect. Specific procedures can be referred to fig. 9, which is a flow chart related to fid_connect and a general flow chart shown in fig. 10.
The difference between fid_ping and fid_connect is that the network service device always selects the path of the existing communication connection to forward for the service request packet containing the service function code FID fid_ping, and does not attempt to establish a new communication connection.
Area identification C_CODE
Central service systems are deployed in different countries and regions, respectively, and each central service system is assigned a region identification C_CODE. In global deployment of not more than 256 central service systems, a region identifier c_code is represented by 1 byte, a region identifier c_code allocated in China is an integer of 1, corresponding to "CN.", a region identifier c_code allocated in the united states is an integer of 0, corresponding to "us.", and when "CN." and "us." are respectively input, and the region identifier c_code is obtained by looking up a table.
For example, "CN. advanced agriculture company: visual manipulator", which constitutes the complete first addressing information of the visual manipulator in fig. 7, wherein "CN." is converted into the regional identification c_code of china by table lookup, "advanced agriculture company" belongs to the real name of the network character string, and after conversion, the six bytes of network identification NID (0 x01, 0x77, 0xEC, 0x73, 0x18, 0x 84) are formed together with the regional identification c_code, and "the visual manipulator" is used as the demarcation point inside and outside the network element, and "the visual manipulator" is parsed into the real name of the service character string, and after conversion, is an integer 2779839086 (0 xA5B0FA 6E) of 4 bytes, which contains the real name switch as "1".
As shown in fig. 7, the communication system provided by the present invention is deployed in both the united states and china, and even in the united states, the client can communicate with the visualization robot located in the high-tech agriculture company in china through the first addressing information contained in the visualization robot of the high-tech agriculture company CN.. Taking the example of sending a service request packet with fid_ping function from a client in the united states to the visualization robot, the data format is shown in table 14, where the data format includes a service identifier s_info (real NAME switch+d_name=0xa 5B0FA6E, FID =0x000A, NID =0x0177 EC 731884), and the switching value 0x0180 represents that both the network identifier switch and the zone switch are "1".
TABLE 14
The network service device connected with the client receives the service request data packet in the table 14, establishes a route record in a return route table by taking a service identifier S_INFO (real NAME switch+D_NAME=0xA5B0FA E, FID =0x000A, NID =0x0177 EC 731884) as a keyword, compares the NID to find that the service request data packet does not belong to a local network unit, forwards the service request data packet to an external network service device, also establishes the route record to the external network service device, and forwards the service request data packet to a central service system of the United states, the central service system of the United states forwards the service request data packet to a central service system of China, and the central service system of the China forwards the service request data packet to a network unit named as 'high-tech agricultural company' according to the NID, and forwards the service request data packet to a visual manipulator in the network unit; in the central service system, the forwarding is also related to, and like the forwarding of the network service device, the forwarding related to the central service system also needs to establish a route record taking the service identifier S_INFO as a keyword so as to ensure that the service response data packet replied by the visual manipulator can reversely return to the client according to the path of the service request data packet.
Friendly communication connection between network elements
If a certain two network elements are involved with a relatively large and frequent amount of communication data, a friendly network element may be provided, with a dedicated physical communication connection channel being used to establish a friendly communication connection for forwarding service request data packets and service reply data packets between the two friendly network elements.
Selecting an external network service device in two network units which are friendly network units, respectively, and establishing a special physical communication connection channel and friendly communication connection between the two external network service devices; distributing the device identifier PID of the external network service device related to the friendly communication connection and the network identifier NID of the friendly network element to all network service devices and recording the device identifier PID and the network identifier NID of the friendly network element by reporting to the upper network service device and distributing to the lower network service device; when forwarding the service request data packet, it is determined based on the network identification NID, and if it belongs to a friendly network element, it is forwarded by the external network service device related to the friendly communication connection.
Internal shared data
Inside the network element, since each tertiary network service device is communicatively connected to one secondary network service device or one primary network service device, each secondary network service device is communicatively connected to all primary network service devices, each primary network service device is communicatively connected to all other primary network service devices, for those internal shared data that must each be recorded, one internal shared data can be saved by reporting to the network service device of the previous stage in stages and then distributing from the primary network service device to the next stage in stages.
The internal shared data includes four types: one is device identification PID and communication address information for each network service device within the network element for establishing an optimized path between the network service devices; the second is that the record of the second corresponding relation formed by the real NAME ID of the server D_NAME of the server and the device ID PID of the network service device connected by the server and the server ID DID of the server is used for converting the real NAME ID of the server D_NAME into an explicit device ID PID and the server ID DID to facilitate addressing when forwarding the service request data packet; third, network identification NID of the present network element and device identification PID of the external network service device, is used for transmitting the service request data packet of the cross network element to the external network service device while transmitting the service request data packet; and fourthly, the network identifier NID of the friendly network element and the device identifier PID of the external network service device related to the friendly communication connection are used for forwarding the service request data packet related to the friendly network element to the corresponding external network service device when forwarding the service request data packet.
NAT server
The network elements are involved in communication, and some short-term FID_PING similar to detecting whether the service end is online can be forwarded through the central service system, and the continuous communication involves a large amount of data, so that a direct communication connection needs to be established between the two network elements.
And each network unit is internally provided with an external network service device, the external network service device is responsible for direct communication connection with other network units, and if the external network service device can be provided with an external communication address W_ADDR which can be directly accessed by other computers on the Internet, no matter a client in the network unit accesses a server in the other network units or vice versa, the client in the other network units accesses the server in the network unit, and the help of the NAT server is not needed. After the external network service device obtains the external communication address W_ADDR of other network units through inquiring the central service system, if the external communication address W_ADDR cannot be directly accessed, the communication connection invitation data packet can be forwarded through the central service system, so that the opposite side can actively establish communication connection with the opposite side.
If the external communication address w_addr provided by both network elements is an address that cannot be directly connected for communication, the communication connection needs to be established with the aid of the NAT server. After the external network service device obtains the external communication address W_ADDR of the opposite network unit, if the external communication address W_ADDR cannot be connected in a communication way, the external network service device is connected to a NAT server, meanwhile, a communication connection invitation data packet containing the NAT server information is forwarded to the opposite network service device in the opposite network unit through a central service system, the external network service device in the opposite network unit receives the communication connection invitation data packet and then is connected to the same NAT server, and a direct TCPIP communication connection is established between the external network service devices of the two parties by utilizing the help of the NAT server, and if the direct TCPIP communication connection cannot be successful, the service request data packet and the service response data packet are forwarded directly through the NAT server.
Network element internal forwarding frequency analysis
Table 15 service request packet forwarding priority table within network element
(excluding the case where the client and the server are the same network service device, the number of forwarding times does not include the last forwarding from the network service device to the server)
As analyzed in table 15, within the network element, forwarding is guaranteed to be able to forward the service request packet sent by the client to the server up to 5 times (including 1 time to the server), and if the network element is optimized such that a direct communication connection can be established between any two network service devices, the maximum number of forwarding times is 2 times.
Trans-network element forwarding frequency analysis
Table 16 service request packet forwarding priority table across network elements
(the number of forwarding times does not include the last forwarding from the network service device to the server)
As analyzed in table 16, in forwarding service request packets across network elements, the forwarding process is divided into three segments, the first segment being within the own network element, the second segment being between network elements, and the third segment being within the opposite network element. And forwarding for 2 times at most in own network unit, forwarding for 2 times at most under the condition of passing through the NAT server between network units, and forwarding for 3 times at most (including 1 time to a server) in opposite network units, wherein the total forwarding for 7 times is at most ensured, and the service request data packet sent by the client can be forwarded to the server. If the network units on two sides are optimized, direct communication connection can be established between any two network service devices, the forwarding is performed for 1 time at most in the own network unit, and the forwarding is performed for 2 times at most in the opposite network unit, and the maximum forwarding times are 5 times; if the network elements can establish direct communication connection, the maximum forwarding times are 4 times, namely 1 time in own network element, 1 time in network element, and 2 times in opposite network element (including 1 time to the server).
And the service request data packet sent by the client side reaches the service side after being forwarded for several times, and the service response data packet is returned to the client side after being forwarded for the same times. By combining the forwarding frequency analysis, it can be concluded that the network system provided by the invention can cover a plurality of countries to form an integral network system, and ensure that any two endpoints have communication capability.
Flow chart
FIG. 9 is a flowchart showing the steps of sending a service request packet from a client, wherein the service function code FID is defined as FID_CONNECT, and when the service request packet is forwarded, the network service device tries to establish or select a communication connection with the least forwarding times according to the priority order, and selects the next network service device under the condition that no communication connection is available and no communication connection can be established, and the priority order is 1; 2. the network server is in communication connection with a superior network server of the target PID; 3. and the communication connection with the upper-level network service device of the network service device. Because of the nature of the network communication system structure of this embodiment, the existing communication connection can assuredly forward the service request packet to the server, and for the service request packet using fid_connect as the service function code FID, the system always tries to establish an optimized path with the minimum number of forwarding times.
The flow chart of fig. 9 is applicable to the case of communication within a network element, also to the case of communication across network elements, and also to the case of communication across countries or regions. After receiving the service request data packet, the external network service device queries the link of obtaining the opposite side w_addr, and can query the external communication address w_addr of the network unit in the country or region, or query the external communication address w_addr of the network unit in other countries or regions through the communication connection between the central service systems.
The flowchart shown in fig. 10 is a general flowchart in this embodiment, in which a service request packet sent from a client does not involve the fid_connect function, and when the network service device forwards the service request packet, the network service device selects a communication connection with the least number of forwarding times according to a priority order, where the priority order is 1; 2. communication connection with a superior network service device of the target PID; 3. and the communication connection with the upper-level network service device of the network service device. Due to the nature of the network communication system architecture of the present embodiment, existing communication connections can securely forward the service request packet to the server.
The flow chart of fig. 10 is applicable to the case of communication within a network element, also to the case of communication across network elements, and also to the case of communication across countries or regions.
Client and server integrated
An operating computer program can have the roles of a client and a server, can send out a service request data packet, has a server DID (direct digital identifier) and even a server real NAME identifier D_NAME, and can receive the service request data packet and respond to the service response data packet. The client and the server are integrated into a whole, and are called as compound terminals.
If the client does not send the service request data packet to apply for the data related to a certain function, the server cannot actively send the data related to the function to the client, so that in order to overcome the limitation, in general, the program a and the program B belong to a composite terminal, the program a sends the service request data packet to the program B, and the program B also sends the service request data packet to the program a, so that any one end of the program a and any one end of the program B can initiate communication related to the certain function, such as chat software, and any one party can actively send characters or other contents.
The network communication method for data forwarding across communication protocols of the embodiment comprises the following steps:
S0, setting central service systems in two or more countries or regions respectively, and distributing region identification C_CODE with 8 bit length to each central service system;
the central service system provides a communication interface of TCPIP protocol to provide service for the network unit;
a NAT server is also arranged;
s1, setting a network unit so that at least one network service device is contained in the network unit, and if the number of the network service devices exceeds one, enabling the network service devices to establish direct or indirect communication connection;
assigning to each network service device a device identification PID for identifying the network service device within range of the network element;
each network service device is also allocated with a broadcasting device identifier PID_B which is used for facilitating the client and the server to search the network service device, the broadcasting device identifier PID_B belongs to a special case of the device identifier PID, the value is an integer 0, and the broadcasting device identifiers PID_B of all the network service devices are the same;
each network service device is also allocated with an integer 0 as a service end identifier DID, and the service end identifiers DID of all the network service devices are the same;
the network service devices are divided into three levels, including a first-level network service device at the uppermost level, a second-level network service device and a third-level network service device at the lowermost level, each third-level network service device is in communication connection with one second-level network service device or one first-level network service device, each second-level network service device is in communication connection with all first-level network service devices, and each first-level network service device is in communication connection with all other first-level network service devices; the device identification PID adopts an integer of 16 bits, and a rule is set for the integer, so that the hierarchy to which each network service device belongs can be deduced according to the number of the device identification PID, and the network service device of the upper stage, which is in communication connection with each three-stage network service device, can be deduced from the number of the device identification PID; reporting the internal shared data to the network service device of the upper stage step by step and distributing the internal shared data to the network service device of the lower stage step by step, so that each network service device stores one part of internal shared data, wherein the internal shared data comprises device identification PID and communication address information of all the network service devices;
The method for establishing a direct communication connection between network service devices comprises the steps of:
s1a, broadcasting and sending a service request data packet in a network service device, wherein the service request data packet comprises a broadcasting device identifier PID_B, a network service device at the upper stage receives the service request data packet and sends reply information, the reply information comprises a communication address of the reply information, and the network service device receives the communication address and establishes communication connection with the network service device at the upper stage;
a plurality of mutually independent physical communication connection channels can be established between the network service devices for enhancing the throughput capacity of data forwarding;
the network unit is opened to the outside to provide an external communication address W_ADDR as an external network service device to receive and send service request data packets and service response data packets, one of the external network service devices is connected to the central service system in a communication way and registers at least one network identifier NID for identifying the network unit with the central service system, each external network service device is connected to the central service system in a communication way and registers the network identifier NID and the external communication address W_ADDR with the central service system; distributing and recording Network Identification (NID) and device identification (PID) of an external network service device bound by a network unit as internal shared data to all network service devices;
Changing the real name of the network character string coded by UNICODE into an integer through CRC32 and CRC16 algorithms, and intercepting 40 bit digits in the integer to obtain a network identifier NID;
a friendly network element can be arranged, so that each external network service device in two network elements which are mutually friendly network elements can establish friendly communication connection for forwarding service request data packets and service response data packets between the two network elements by utilizing a special physical communication connection channel; distributing the device identifier PID of the external network service device related to the friendly communication connection and the network identifier NID of the friendly network element as internal shared data to all network service devices and recording the internal shared data;
if the network identification NID contains the area identification c_code of the central service system to which the communication is connected, the length becomes 48 bits;
the TCPIP protocol is adopted for enabling the external network service device to be in communication connection with the central service system, and the external communication address W_ADDR provided by the external network service device is based on the TCPIP protocol;
s2, a plurality of service function codes FID are provided inside the service end, so that the service end and a network service device are in communication connection, and the service end obtains first addressing information for addressing the service end in the range of a network unit;
A service end identifier DID for identifying the service end in the range of the network service device in communication connection is also distributed to the service end; the first addressing information explicitly or implicitly comprises a service end identifier DID of the service end and a device identifier PID of a network service device which is in communication connection with the service end;
the service end identification DID and the real-name switch form a 16-bit integer, the service end identification DID is a 15-bit integer, and rules are set for the integer, so that a specific integer represents a plurality of service ends connected to the same network service device;
the method for establishing communication connection between the server and the network service device comprises the following steps:
s2a, broadcasting and sending a service request data packet at a server, wherein the service request data packet comprises a broadcasting device identifier PID_B, receiving the service request data packet at a network service device, and sending reply information, wherein the reply information comprises a communication address of the network service device, receiving the communication address at the server and establishing communication connection with the network service device;
the service function code FID is an integer of 16 bits, a standardized service function interval and a custom service function interval are divided according to a value interval of the integer, and the function definition of the service function code FID with the value falling in the standardized service function interval is standardized;
Defining a standardized service function code FID_PING for testing whether a service end is online or not in a standardized service function interval;
registering a service end real NAME identifier D_NAME for identifying the service end in the range of the network element for the network service device which is in communication connection with the service end, generating a record of a second corresponding relation, including the service end real NAME identifier D_NAME, the service end identifier DID of the service end and the device identifier PID of the network service device which is in communication connection with the service end, reporting the record of the second corresponding relation as internal shared data to the network service device of the upper stage step by step and distributing the record of the second corresponding relation to the network service device of the lower stage step by step, so that each network service device stores the record of the second corresponding relation in a second corresponding relation registry; the real NAME identifier D_NAME of the server and the real NAME switch together form a 32-bit integer;
changing the real NAME of the service end character string coded by UNICODE into an integer through a CRC322 algorithm, and intercepting 31 bits in the integer to obtain a service end real NAME identifier D_NAME;
defining a standardized service function code FID_CONNECT for establishing an optimized path between a client and a server in a standardized service function interval;
Setting a standardized server character string real name list consisting of a plurality of server character string real names, wherein each server character string real name represents a standardized server with a specific function;
s3, the client establishes communication connection with a network service device and sends a service request data packet to the network service device, wherein the service request data packet comprises a service identifier S_INFO, and the service identifier S_INFO comprises first addressing information of the service terminal and at least one service function code FID of the service terminal;
the service request data packet further comprises a direction switch for distinguishing the service request data packet from the service response data packet, and the service identifier s_info further comprises a service function code FID of the service end;
the service request data packet also comprises a deleting switch of bit information and a single switch, wherein the deleting switch represents a deleting instruction when the deleting switch is 1, and the single switch only needs to return one data when the deleting switch is 1;
the service request data packet also comprises a multi-function switch with bit information, and when the multi-function switch is 1, the service identifier S_INFO also comprises multi-function code data for representing a plurality of continuous service function codes FID by taking the service function code FID as a reference point;
The service request data packet may be issued at the same time by a plurality of the clients, wherein the service identification s_info contains the same or the service function codes FID intersect and the other parts are the same;
the service request data packet also comprises an additional function code for adding definition to the service function code FID;
the service request data packet also comprises data length information for extracting the data packet from the stream data;
the service request data packet also comprises at least one standby switch for expanding functions, and each standby switch is 1 bit;
the service request data packet also comprises a user switch with bit information, and when the user switch is 1, the service identifier S_INFO comprises a user identifier UID for identifying user identity information or distinguishing different clients;
the service request data packet also comprises a priority switch of bit information, and when the priority switch is 1, the service request data packet also comprises a priority code for prompting the priority level of the data;
the service request data packet also comprises a serial number switch of bit information, and when the serial number switch is 1, the service request data packet also comprises a data packet serial number for dividing one service request data packet into multiple transmissions;
The method for enabling the client to establish communication connection with the network service device comprises the following steps:
s3a, broadcasting and sending a service request data packet at a client, wherein the service request data packet comprises a broadcasting device identifier PID_B, receiving the service request data packet at a network service device, and sending reply information, wherein the reply information comprises a communication address of the reply information, receiving the communication address at the client and establishing communication connection with the network service device;
the service identifier s_info also contains a real-NAME switch of bit information, and when the real-NAME switch is marked as "1", it indicates that the service identifier s_info contains a service-side real-NAME identifier d_name, instead of explicitly containing a device identifier PID and a service-side identifier DID;
the service request data packet also comprises a network identification switch for marking whether the service identification S_INFO comprises a network identification NID;
the service request data packet also comprises a region switch for marking whether the network identifier NID comprises a region identifier C_CODE;
changing the real name of a user character string coded by UNICODE into an integer through CRC32 and CRC16 algorithms, and intercepting 40 bit digits in the integer to obtain a user identification UID;
s4, receiving a service request data packet in a network service device, recording a path sent by the service request data packet by taking a service identifier S_INFO in the service request data packet as a keyword, and forwarding the service request data packet once or forwarding the service request data packet for a plurality of times through direct or indirect communication connection between the network service devices according to first addressing information, and then sending the service request data packet to a corresponding service end;
The steps of recording the path from which the service request packet is sent are as follows:
s4a records the communication address peer_addr of the peer when receiving the service request data packet, and forms a route record with the service identifier S_INFO, and inserts or updates the route record in the return route table;
the step of forwarding the service request data packet to the server is as follows:
s4b judges whether the service request data packet corresponds to the service end which is in communication connection with the service end according to the service identifier S_INFO, if so, the service request data packet is forwarded to the service end, if not, an optimal network service device is selected from other connected and known network service devices according to the service identifier S_INFO, the service request data packet is forwarded to the optimal next network service device, and the same process as that of the step S4, the step S4a and the step S4b is executed by the optimal next network service device until the service request data packet is forwarded to the service end;
the physical communication connection channel when the network service device receives the service request data packet is the same as or different from the physical communication connection channel when the service request data packet is forwarded, the communication protocol used when the network service device receives the service request data packet is the same as or different from the communication protocol used when the service request data packet is forwarded, and the peer_addr comprises the information of the physical communication connection channel, the communication protocol used and the communication address used for sending the returned service response data packet according to the communication protocol;
The service request data packet is forwarded to all the service terminals represented by the service terminal identification DID;
forwarding the service request data packet from the network service device to other network service devices, if not, forwarding the service request data packet through the previous network service device of the opposite party or the previous network service device of the own party;
when forwarding the service request data packet, selecting one forwarding service request data packet from a plurality of mutually independent physical communication connection channels among the network service devices according to the priority code contained in the service request data packet;
if the service identifier S_INFO contains a service end real NAME identifier D_NAME, inquiring a second corresponding relation registration table to find out a device identifier PID and a service end identifier DID which are implied by the service end real NAME identifier D_NAME;
when forwarding a service request data packet, if the service identifier s_info does not contain a network identifier NID, the service identifier s_info is considered to be forwarded in the same network unit, otherwise, if the network identifier NID contained in the service identifier s_info does not belong to the network unit where the service identifier s_info is located, the service identifier s_info is forwarded to an external network service device, so that the external network service device queries a central service system to obtain an external communication address w_addr of the network unit of the opposite party and then forwards the data packet, or submits the data packet to the central service system to forward the data packet;
Judging according to a network identifier NID when forwarding the service request data packet, and forwarding through an external network service device related to the friendly communication connection if the service request data packet belongs to the friendly network element;
when inquiring the central service system to obtain the external communication address W_ADDR of the opposite network unit, if the area identifier C_CODE contained in the network identifier NID does not belong to the home country or the area, inquiring the external communication address W_ADDR of the opposite network unit through the communication connection between the central service system of the home country or the area and the central service system containing the area identifier C_CODE;
after the external network service device obtains the external communication address W_ADDR of the opposite network unit, if the external communication address W_ADDR cannot be connected in a communication way, connecting to a NAT server, and simultaneously forwarding a communication connection invitation data packet containing the NAT server information to an external network service device in the opposite network unit through a central service system, so that the external network service device in the opposite network unit receives the communication connection invitation data packet and then connects to the same NAT server, and a direct TCPIP connection is established between the external network service devices of the two parties by utilizing the help of the NAT server, and if the direct TCPIP connection cannot be successful, forwarding a service request data packet and a service response data packet through the NAT server directly;
S5, receiving a service request data packet at a service end, sending a corresponding service response data packet to a network service device in communication connection with the service end according to the service request data packet, wherein the service response data packet comprises a service identifier S_INFO, and establishing a first corresponding relation between the service response data packet and the service request data packet according to the service identifier S_INFO;
the service response data packet further comprises a direction switch for distinguishing the service request data packet from the service response data packet; the first correspondence includes two cases, one is that the service request packet and the service response packet have the same service identifier s_info, and the other is that the service request packet and the service response packet have the service identifier s_info with the service function code FID intersecting and the other part being the same;
the service response data packet further comprises a multifunctional switch, and when the multifunctional switch is 1, the service identifier S_INFO representing the service response data packet further comprises multifunctional code data for representing a plurality of continuous service function codes FID by taking the service function code FID as a reference point;
the service response data packet also comprises an additional function code;
the service response data packet also contains data length information;
the service response data packet also comprises at least one standby switch;
The service response data packet also comprises a user switch, and when the user switch is 1, the service identifier S_INFO of the service response data packet comprises a user identifier UID;
the service response data packet also comprises a priority switch, and when the priority switch is 1, the service response data packet also comprises a priority code;
the service response data packet also comprises a sequence number switch, and when the sequence number switch is 1, the service response data packet also comprises a data packet sequence number;
the service response data packet also comprises a network identification switch for marking whether the service identification S_INFO comprises a network identification NID;
the service response data packet also comprises a region switch for marking whether the network identifier NID comprises a region identifier C_CODE;
s6, receiving the service response data packet at the network service device, searching a corresponding path of the service request data packet for the service response data packet according to the first corresponding relation, and reversely returning the service response data packet from the path to the client;
the step of returning the service response data packet to the client at the network service device is as follows:
s6a queries a return route table, finds a route record with which the service identifier S_INFO is identical or with which the service function code FID contained in the service identifier S_INFO is intersected and the other part is identical according to the service identifier S_INFO contained in the service response data packet, forwards the service response data packet to a peer_addr in the route record, if the peer_addr corresponds to a non-client side, corresponds to a network service device, and executes the same steps as the step S6 and the step S6a in the corresponding network service device until the service response data packet is forwarded to the client side;
The service response data packet received by the network service device also comprises a delete switch and a single switch; if the deleting switch is indicated as a deleting instruction, deleting the route record with the service identifier S_INFO in the return route table according to the service identifier S_INFO contained in the service response data packet; if the single switch indicates that only one data needs to be returned, after the forwarding of the service response data packet is completed, deleting the route record with the same service identifier S_INFO in the return route table according to the service identifier S_INFO contained in the service response data packet; if the route record is not updated in the set time, deleting the route record;
if the same service response data packet finds a plurality of route records in the return route table according to the first corresponding relation, the service response data packet is returned to a plurality of clients.

Claims (56)

1. A network communication system for data forwarding across communication protocols is characterized by comprising a client, a server and a network unit; the network element comprises at least one network service device; if the number of the network service devices contained in the network unit exceeds one, establishing direct or indirect communication connection between the network service devices;
The client is used for establishing communication connection with one network service device and sending a service request data packet to the network service device, wherein the service request data packet comprises a service identifier S_INFO, and the service identifier S_INFO comprises first addressing information for addressing the service terminal and at least one of a plurality of service function codes FID provided inside the service terminal;
the service end is used for establishing communication connection with one network service device and sending a service response data packet to the network service device according to the received service request data packet, wherein the service response data packet comprises the service identifier S_INFO, and a first corresponding relation is established between the service response data packet and the service request data packet according to the service identifier S_INFO;
the network service device is used for forwarding the service request data packet once or multiple times by utilizing a single network service device or multiple network service devices according to the first addressing information, and recording a path from which the service request data packet is sent by taking the service identifier S_INFO as a keyword in each forwarding; the network service device is further configured to search, through the first correspondence, a path of a corresponding service request packet for the service response packet, so as to return the service response packet to the client.
2. The network communication system of claim 1, wherein,
each of said network service devices being assigned a device identification PID for identifying said network service device within said network element;
the server is also allocated a server identifier DID for identifying the server within the range of the network service device to which the server is connected in a communication manner;
the service request data packet and the service response data packet further comprise a direction switch for distinguishing the service request data packet and the service response data packet, and the first addressing information explicitly or implicitly comprises the service end identifier DID of the service end and the device identifier PID of the network service device to which the service end is communicatively connected;
the first correspondence includes two cases, one is that the service request packet and the service response packet have the same service identifier s_info, and the other is that the service request packet and the service response packet have the service identifier s_info with the intersection of the service function codes FID and the other is the same.
3. The network communication system for data forwarding across a communication protocol according to claim 2, wherein the network service device comprises a receiver, a request data processing module, and a response data processing module;
The receiver is configured to receive the service request packet and the service response packet from a client, a server, or other network service devices, determine a class of the service request packet according to the direction switch, submit the service request packet and a communication address peer_addr of a counterpart when the service request packet is received to the request data processing module, and submit the service response packet to the response data processing module;
the request data processing module is used for generating a route record corresponding to the service identifier S_INFO and the peer_addr in the service request data packet, inserting or updating the route record in a return route table, and forwarding the service request data packet to the local service end or the optimal one of the connected and known other network service devices according to the prompt of the service identifier S_INFO so that the service request data packet is forwarded to the service end after being forwarded for a plurality of times;
the response data processing module is configured to search the route record of the service request data packet corresponding to the service response data packet according to the first correspondence, and forward the service response data packet to the peer_addr in the route record conforming to the first correspondence.
4. A network communication system according to claim 3, wherein a deletion rule is set for said route record, said deletion rule including receiving an instruction to delete, returning data once, and deleting after more than one time period said service request packet not corresponding to said route record.
5. A network communication system according to claim 3, wherein the physical communication connection channel when the network service device receives the service request packet is the same as or different from the physical communication connection channel when the service request packet is forwarded, the communication protocol used when the network service device receives the service request packet is the same as or different from the communication protocol used when the service request packet is forwarded, and the peer_addr contains information of the physical communication connection channel, the communication protocol used, and the address used for sending the returned service response packet according to the communication protocol.
6. A network communication system according to claim 3, wherein said service request packet and said service response packet further comprise a multi-function switch for marking whether said service identifier s_info contains a plurality of consecutive service function codes FID, and wherein a value of one of "0" and "1" of said multi-function switch indicates that said service identifier s_info further comprises multi-function code data for representing a plurality of consecutive service function codes FID with said service function code FID as a reference point, and said network service device determines whether to forward said service response packet based on whether said service identifier s_info in said service response packet and said service identifier s_info in said return route table contain any of the same service function codes FID of the same service end when said return route table is queried.
7. A network communication system according to claim 3, wherein said service end identifier DID is a fixed length integer having a length between 8 bits and 64 bits, and wherein said rules set for said integer are such that said service request packet containing a specific integer as said service end identifier DID is forwarded to a plurality of said service ends communicatively connected to the same network service device.
8. A network communication system according to claim 3, wherein said service response packet is returned to said plurality of clients when said service request packets issued by said plurality of clients over a period of time include said service identifier s_info which is identical or said service function code FID intersects and other parts are identical.
9. A network communication system according to claim 3, wherein said service request data packet and said service reply data packet further comprise additional function codes for additional definition of said service function code FID.
10. A network communication system according to claim 3, wherein the service request packet and the service reply packet further comprise data length information for determining packet boundaries in the streaming data to extract the data packets.
11. A network communication system according to claim 3, wherein said service request packet and said service reply packet further comprise a plurality of backup switches for extending system functions, each of said backup switches being 1 bit, including an extended backup switch, and wherein a value of one of "0" and "1" of said extended backup switch indicates that said service request packet and said service reply packet further comprise more of said backup switches.
12. A network communication system according to claim 3, wherein said service request packet and said service response packet further comprise a user switch with a bit information, and wherein a value of one of "0" and "1" of said user switch indicates that said service identifier s_info contains a user identifier UID for identifying user identity information or distinguishing different clients.
13. A network communication system according to claim 3, wherein said service request packet and said service reply packet further comprise a priority switch for bit information, and wherein one of "0" and "1" of said priority switch is valued to indicate that said service request packet and said service reply packet further comprise priority codes for prompting data priority.
14. The network communication system of claim 3, wherein said service request packet and said service response packet further comprise a sequence number switch for bit information, and wherein a value of one of "0" and "1" of said sequence number switch indicates that said service request packet and said service response packet further comprise packet sequence numbers for dividing the data of the packet into a plurality of transmissions.
15. A network communication system for data forwarding across a communication protocol according to claim 3 wherein each of said network service devices is further assigned a broadcaster identification pid_b for facilitating said client and said server to search for said network service device, said broadcaster identification pid_b being a special case of said device identification PID, said broadcaster identifications pid_b of all said network service devices being the same; the client obtains the response of the network service device by broadcasting and sending a broadcast data packet, thereby finding the network service device and establishing communication connection, wherein the broadcast data packet accords with the specification of the service request data packet and comprises the identifier PID_B of the broadcasting device; the server obtains the response of the network service device by broadcasting and sending broadcast data, thereby finding the network service device and establishing communication connection, wherein the broadcast data packet accords with the specification of the service request data packet and contains the identifier PID_B of the broadcast device; the network service device does not forward the service request packet containing the broadcaster identification pid_b.
16. A network communication system according to claim 3, wherein each of said network service devices is further assigned a service end identifier DID, and wherein said service end identifiers DID of all of said network service devices are identical.
17. A network communication system according to claim 3, wherein the service function code FID is an integer of a fixed length, the length is between 8 bits and 64 bits, the standardized service function interval and the custom service function interval are divided according to a value interval of the integer, and the function definition of the service function code FID with a value falling in the standardized service function interval is standardized.
18. The network communication system according to claim 17, wherein a standardized service function code fid_ping for testing whether the service terminal is online is defined in the standardized service function section.
19. The network communication system of any one of claims 3-18, wherein said network service devices are divided into three tiers, including a top level primary network service device, a secondary network service device, and a bottom level tertiary network service device, each said tertiary network service device being communicatively coupled to one said secondary network service device or one said primary network service device, each said secondary network service device being communicatively coupled to all said primary network service devices, each said primary network service device being communicatively coupled to all other said primary network service devices, communication connections between network service devices being for forwarding said service request packets, and for distributing internal shared data such that each said network service device holds a share of the internal shared data, said internal shared data including said device identification PID and communication address information for each said network service device within said network element; the device identification PID adopts an integer with a fixed length, the length is between 8 bits and 64 bits, and a rule is set for the integer, so that the hierarchy of each network service device can be deduced according to the number of the device identification PID, and the network service device of the upper stage, which is in communication connection with each three-stage network service device, can be deduced according to the number of the device identification PID; the network service device records the communication address information of other network service devices and is used for establishing direct communication connection with the other network service devices so as to forward the service request data packet.
20. The network communication system of claim 15, wherein said network service device obtains a response of a previous stage of said network service device by broadcasting a broadcast packet that conforms to a specification of said service request packet and contains said broadcaster identification pid_b, thereby finding said network service device of a previous stage and establishing a communication connection.
21. The network communication system of claim 13, wherein a plurality of mutually independent physical communication connection channels are established between the network service devices for enhancing throughput of data forwarding.
22. The network communication system of claim 21, wherein a physical communication connection path for data forwarding is selected from among a plurality of physical communication connection paths independent of each other between two network service devices based on the priority code included in the service request packet.
23. The network communication system according to claim 19, further characterized in that a server real NAME identifier d_name for identifying the server within the network element is allocated to the server, the server real NAME identifier d_name of the server and the device identifier PID of the network service device to which the server is communicatively connected and the server identifier DID of the server form a second correspondence, and the internal shared data further includes a record of the second correspondence; the service identifier s_info also contains a real-NAME switch with bit information, and one of "0" and "1" of the real-NAME switch takes a value, which indicates that the service identifier s_info contains one of the service-side real-NAME identifiers d_name, otherwise the service identifier s_info explicitly contains one of the device identifiers PID and one of the service-side identifiers DID.
24. The network communication system of claim 23, comprising at least two of said network elements, further comprising a central service system; each of said network elements being assigned at least one network identification NID for identifying said network element within said network communication system; each network unit opens at least one network service device to the outside as an external network service device for providing an external communication address w_addr to receive and send the service request data packet and the service response data packet, and the external network service device is also used for being connected to the central service system in a communication way; the internal shared data further comprises the network identification NID of the network element and the device identification PID of the external network service device; the central service system is used for forwarding the service request data packet and the service response data packet between two network units, and is also used for registering and inquiring the network identifier NID and the external communication address W_ADDR of the network units; the service request data packet and the service response data packet further comprise a network identification switch for marking whether the service identifier s_info contains the network identifier NID, the service identifier s_info does not contain the network identifier NID, which indicates that communication only occurs in the same network element, otherwise, if the network identifier NID contained in the service identifier s_info does not belong to the network element where the network identifier NID does not belong to, the service request data packet and the service response data packet are forwarded between the two network elements, and the external network service device queries the central service system to obtain the external communication address w_addr of the network element of the other party, establishes communication connection between the two network elements and then forwards the communication connection, or submits the communication connection to the central service system to forward the communication connection.
25. The network communication system for data forwarding across communication protocols according to claim 24, wherein said server-side real NAME identifier d_name has a fixed number of bits, and is obtained by converting a server-side character string real NAME into an integer by a specific algorithm, and intercepting the fixed number of bits therein; the network identifier NID has a fixed bit number, which is obtained by changing the real name of a network character string into an integer through a specific algorithm and intercepting the fixed bit number therein; and the real names of the server-side character strings and the real names of the network character strings are coded by UNICODE.
26. The network communication system of claim 17, wherein a standardized service function code fid_connect for establishing an optimized path between the client and the server is defined in the standardized service function interval.
27. The network communication system according to claim 25, wherein a standardized server string real name list comprising at least one server string real name is provided, wherein each server string real name represents a standardized server for a specific function.
28. The network communication system of claim 27, wherein two of said network elements are friendly network elements to each other, and a dedicated physical communication connection channel is utilized to establish a friendly communication connection for forwarding said service request data packet and said service reply data packet between two of said friendly network elements; the internal shared data further comprises the network identification NID of the friendly network element and the device identification PID of the external network service device related to the friendly communication connection.
29. The network communication system according to claim 28, comprising two or more than two central service systems, each of which is set in a different country or region, and each of which is assigned a region identifier c_code, wherein a communication connection is established between any two of the central service systems, for mutually querying the external communication address w_addr of the network unit within the range of the other party, and for forwarding the service request packet and the service response packet; the service request packet and the service response packet further include a zone switch with bit information, where one of "0" and "1" of the zone switch takes a value, which indicates that the network identifier NID includes the zone identifier c_code of the central service system to which the corresponding network element is communicatively connected.
30. The network communication system for data forwarding across a communication protocol of claim 29, further comprising a NAT server; the network units and the central service system establish communication connection by adopting a TCPIP protocol, the two network units are connected to the NAT server by adopting the TCPIP protocol, and the direct communication connection between the two network units is realized by the help of the NAT server, or the service request data packet and the service response data packet between the two network units are forwarded by the NAT server directly.
31. The network communication method for data forwarding across communication protocols is characterized by comprising the following steps:
s1, setting a network unit so that at least one network service device is contained in the network unit, and if the number of the network service devices exceeds one, enabling the network service devices to establish direct or indirect communication connection;
s2, enabling a plurality of service function codes FIDs to be provided inside a service end, enabling the service end to establish communication connection with one network service device, and enabling the service end to obtain first addressing information for addressing the service end in the range of the network unit;
S3, the client establishes communication connection with one network service device and sends a service request data packet to the network service device, wherein the service request data packet comprises a service identifier S_INFO, and the service identifier S_INFO comprises the first addressing information of the service terminal and at least one service function code FID of the service terminal;
s4, receiving the service request data packet at the network service device, recording a path sent by the service request data packet by taking the service identifier S_INFO in the service request data packet as a keyword, and then forwarding the service request data packet once or forwarding the service request data packet for a plurality of times through direct or indirect communication connection between the network service devices according to the first addressing information, and then sending the service request data packet to the corresponding service end;
s5, receiving the service request data packet at the service end, and sending a corresponding service response data packet to the network service device in communication connection with the service end according to the service request data packet, wherein the service response data packet comprises the service identifier S_INFO, and a first corresponding relation is established between the service response data packet and the service request data packet according to the service identifier S_INFO;
S6, receiving the service response data packet at the network service device, searching a path of a corresponding service request data packet for the service response data packet according to the first corresponding relation, and reversely returning the service response data packet from the path to the client.
32. The network communication method according to claim 31, wherein in said step S1, each of said network service devices is assigned a device identification PID for identifying said network service device within said network element;
in the step S2, a service identifier DID for identifying the service within the range of the network service device in communication connection is further allocated to the service; the first addressing information explicitly or implicitly comprises the service end identifier DID of the service end and the device identifier PID of the network service device which the service end is in communication connection with;
in the step S3, the service request packet further includes a direction switch for distinguishing the service request packet from the service response packet, and the service identifier s_info further includes the service function code FID of the service end;
In the step S5, the service response packet further includes a direction switch for distinguishing the service request packet from the service response packet; the first correspondence includes two cases, one is that the service request packet and the service response packet have the same service identifier s_info, and the other is that the service request packet and the service response packet have the service identifier s_info with the intersection of the service function codes FID and the other is the same.
33. The method according to claim 32, wherein in step S4, the step of recording the path from which the service request packet is sent is as follows:
s4a records the communication address peer_addr of the peer when receiving the service request data packet, and forms a route record with the service identifier S_INFO, and inserts or updates the route record in a return route table;
in the step S4, the step of forwarding the service request packet to the server side is as follows:
s4b judges whether the service request data packet corresponds to the service end which is in communication connection with the service end according to the service identifier S_INFO, if so, the service request data packet is forwarded to the service end, if not, an optimal network service device is selected from other connected and known network service devices according to the service identifier S_INFO, the service request data packet is forwarded to the optimal next network service device, and the same process as the steps S4, S4a and S4b is executed in the optimal next network service device until the service request data packet is forwarded to the service end;
In the step S6, the step of returning the service response packet to the client at the network service device is as follows:
s6a queries the return route table, finds the route record with the service identifier S_INFO identical to the service identifier S_INFO or with the service function code FID included in the service identifier S_INFO intersected with the service identifier S_INFO and the other part identical to the service function code FID, forwards the service response data packet to the peer_addr in the route record, if the peer_addr corresponds to a client, the network service device corresponds to the peer_addr, and performs the same steps as the step S6 and the step S6a on the corresponding network service device until the service response data packet is forwarded to the client.
34. The network communication method according to claim 33, wherein in the step S3, the service request packet further includes a delete switch for bit information and a single switch, wherein one value of "0" and "1" of the delete switch represents a delete instruction, and one value of "0" and "1" of the single switch represents that only one data needs to be returned; in the step S6, the service response packet received by the network service device further includes the delete switch and the single switch; if the deletion switch is indicated as the deletion instruction, deleting the route record with the service identifier S_INFO identical to the service identifier S_INFO in the return route table according to the service identifier S_INFO contained in the service response data packet; if the single switch indicates that only one data needs to be returned, deleting the routing record with the same service identifier S_INFO in the return route table according to the service identifier S_INFO contained in the service response data packet after the service response data packet is forwarded; and if the route record is not updated in the set time, deleting the route record.
35. The network communication method according to claim 33, wherein in the step S4, the step S4a and the step S4b, the physical communication connection channel used when the network service device receives the service request packet is the same as or different from the physical communication connection channel used when the service request packet is forwarded, the communication protocol used when the network service device receives the service request packet is the same as or different from the communication protocol used when the service request packet is forwarded, and the peer_addr includes information of the physical communication connection channel, the communication protocol used, and the communication address used when the service response packet is sent back according to the communication protocol.
36. The network communication method according to claim 33, wherein in the step S3, the service request packet further includes a multi-function switch with a bit information, and one of "0" and "1" of the multi-function switch is valued to indicate that the service identifier s_info further includes multi-function code data for representing a plurality of consecutive service function codes FID with the service function code FID as a reference point; in the step S5, the service response packet further includes a multi-function switch, where a value of one of "0" and "1" of the multi-function switch indicates that the service identifier s_info further includes multi-function code data for representing a plurality of consecutive service function codes FID with the service function code FID as a reference point.
37. The network communication method according to claim 33, wherein in the step S2, the service side identifier DID is an integer of a fixed length, and the length is between 8 bits and 64 bits; and in the step S4 and the step S4b, the service request data packet is forwarded to all the service terminals represented by the service terminal identification DID.
38. The network communication method according to claim 33, wherein in step S2, the service request packets sent by the plurality of clients for a period of time include the same or the service identities s_info having the service function codes FID intersected and the other part being the same; in the step S6, since the same service response packet finds a plurality of route records in the return route table according to the first correspondence, the service response packet is returned to a plurality of clients.
39. The network communication method according to claim 33, wherein in step S3, the service request packet further includes an additional function code for additional definition of the service function code FID; in the step S5, the service response packet further includes the additional function code.
40. The network communication method according to claim 33, wherein in step S3, the service request packet further includes data length information for extracting a data packet from the streaming data; in the step S5, the service response packet further includes the data length information.
41. The network communication method according to claim 33, wherein in step S3, the service request packet further includes at least one spare switch for extending a function, and each spare switch is 1 bit; in the step S5, the service response packet further includes at least one of the standby switches.
42. The network communication method according to claim 33, wherein in the step S3, the service request packet further includes a user switch with bit information, and one of "0" and "1" of the user switch takes a value, which indicates that the service identifier s_info includes a user identifier UID for identifying user identity information or distinguishing different clients; in the step S5, the service response packet further includes the user switch, and one of "0" and "1" of the user switch is valued, which indicates that the service identifier s_info of the service response packet includes the user identifier UID.
43. The network communication method according to claim 33, wherein in the step S3, the service request packet further includes a priority switch of bit information, and a value of one of "0" and "1" of the priority switch indicates that the service request packet further includes a priority code for prompting a priority level of data; in the step S5, the service response packet further includes a priority switch, where a value of one of "0" and "1" of the priority switch indicates that the service response packet further includes the priority code.
44. The network communication method according to claim 33, wherein in the step S3, the service request packet further includes a sequence number switch of bit information, and one of "0" and "1" of the sequence number switch is a value indicating that the service request packet further includes a packet sequence number for dividing the service request packet into multiple transmissions; in the step S5, the service response packet further includes a sequence number switch, and a value of one of "0" and "1" of the sequence number switch indicates that the service response packet further includes the packet sequence number.
45. The network communication method according to claim 33, wherein in said step S1, each of said network service devices is further assigned a broadcaster id pid_b for facilitating said client and said server to search for said network service device, said broadcaster id pid_b belonging to a special case of said device id PID, said broadcaster ids pid_b of all said network service devices being identical;
in the step S2, the method for establishing a communication connection between the server and the network service device includes the following steps:
s2a broadcasts and sends the service request data packet at the service end, wherein the service request data packet comprises the broadcasting device identifier PID_B, the network service device receives the service request data packet and sends reply information, the reply information comprises the communication address of the network service device, and the service end receives the communication address and establishes communication connection with the network service device;
in the step S3, the method for establishing a communication connection between the client and the network service device includes the steps of:
s3a, broadcasting and sending the service request data packet at the client, wherein the service request data packet comprises the broadcasting device identifier PID_B, receiving the service request data packet at the network service device, and sending reply information, wherein the reply information comprises a communication address of the reply information, receiving the communication address at the client and establishing communication connection with the network service device.
46. The network communication method according to claim 33, wherein in step S1, each of the network service devices is further assigned a service end identifier DID, and the service end identifiers DID of all the network service devices are the same.
47. The network communication method according to claim 33, wherein in the step S2, the service function code FID is an integer with a fixed length, the length is between 8 bits and 64 bits, a standardized service function interval and a custom service function interval are divided according to a value interval of the integer, and the function definition of the service function code FID with a value falling in the standardized service function interval is standardized.
48. The network communication system according to claim 47, wherein in the step S2, a standardized service function code fid_ping for testing whether the service terminal is online is defined in the standardized service function interval.
49. The network communication method according to any one of claims 33 to 48, wherein in the step S1, the network service devices are divided into three levels including a primary network service device of a highest level, a secondary network service device, and a tertiary network service device of a lowest level, each of the tertiary network service devices is made to be communicatively connected to one of the secondary network service devices or the primary network service device, each of the secondary network service devices is made to be communicatively connected to all of the primary network service devices, and each of the primary network service devices is made to be communicatively connected to all of the other primary network service devices; the device identification PID adopts an integer with a fixed length, the length is between 8 bits and 64 bits, and a rule is set for the integer, so that the hierarchy to which each network service device belongs can be deduced according to the number of the device identification PID, and the network service device of the upper stage, which is in communication connection with each three-stage network service device, can be deduced from the number of the device identification PID; reporting internal shared data to the network service devices of the upper stage step by step and distributing the internal shared data to the network service devices of the lower stage step by step, so that each network service device stores one part of the internal shared data, wherein the internal shared data comprises device identification PID and communication address information of all the network service devices; in the step S4 and the step S4a, if the service request packet is not successfully forwarded from the network service device to the other network service devices, the service request packet is forwarded through the network service device of the previous stage of the opposite party or the network service device of the previous stage of the own party.
50. The method for network communication across communication protocol data forwarding according to claim 45, wherein in step S1, the method for establishing a direct communication connection between the network service devices comprises the steps of:
s1a broadcasts and transmits the service request data packet in the network service device, wherein the service request data packet comprises the broadcasting device identifier PID_B, the network service device at the upper stage receives the service request data packet and transmits reply information, the reply information comprises a communication address of the network service device, and the network service device receives the communication address and establishes communication connection with the network service device at the upper stage.
51. The method according to claim 43, wherein in step S1, a plurality of mutually independent physical communication connection channels are established between the network service devices for enhancing throughput of data forwarding.
52. The method according to claim 51, wherein in step S4 and step S4b, one of a plurality of mutually independent physical communication connection channels between the network service devices is selected to forward the service request packet according to the priority code included in the service request packet.
53. The method according to claim 49, wherein in step S2, a record of a second correspondence is further generated by registering a service-side real NAME identifier D_NAME for identifying the service side within the network element for the network service device to which the service side is communicatively connected, including the service-side real NAME identifier D_NAME, the service-side identifier DID of the service side, and the device identifier PID of the network service device to which the service side is communicatively connected, and the record of the second correspondence is distributed as the internal shared data to the network service device of the upper stage and the network service device of the lower stage in stages, so that each of the network service devices stores the record of the second correspondence in a second correspondence registration table; in the step S3, the service identifier s_info further includes a real-NAME switch of bit information, and a value of one of "0" and "1" of the real-NAME switch flag indicates that the service identifier s_info includes the service-side real-NAME identifier d_name, instead of explicitly including the device identifier PID and the service-side identifier DID; in the step S4 and the step S4b, if the service identifier s_info includes the service end real NAME identifier d_name, the second correspondence registration table is queried to find out one device identifier PID and one service end identifier DID implied by the service end real NAME identifier d_name.
54. The method for network communication across communication protocol data forwarding according to claim 53, further comprising the steps of, before said step S1:
s0, setting a central service system, and providing a network communication interface to provide services for the network unit;
and, in said step S1, causing said network unit to open at least one of said network service devices to the outside as an external network service device providing an external communication address w_addr to receive and transmit said service request packet and said service response packet, causing one of said external network service devices to be communicatively connected to said central service system and registering with the central service system at least one network identification NID for identifying said network unit, causing each of said external network service devices to be communicatively connected to the central service system and registering with the central service system said network identification NID and said external communication address w_addr; distributing the network identifier NID bound by the network unit and the device identifier PID of the external network service device to all the network service devices as the internal shared data and recording the internal shared data;
in the step S3, the service request packet further includes a network identifier switch for marking whether the service identifier s_info includes the network identifier NID;
In the step S4 and the step S4b, when forwarding the service request packet, if the network identifier NID is not included in the service identifier s_info, the service request packet is considered to be forwarded in the same network element, otherwise, if the network identifier NID included in the service identifier s_info is not included in the network element where the network identifier NID is included, the service request packet is forwarded to the external network service device, so that the external network service device queries the central service system to obtain the external communication address w_addr of the network element of the other party and then forwards the network element, or submits the network element to the central service system for forwarding;
in the step S5, the service response packet further includes the network identifier switch for marking whether the service identifier s_info includes the network identifier NID.
55. The network communication system according to claim 47, wherein in the step S2, standardized service function codes fid_connect for establishing an optimized path between the client and the server are defined in the standardized service function interval.
56. A network service device for network communication based on data forwarding across communication protocols, which is characterized by comprising a receiver, a request data processing module and a response data processing module;
The network service devices are configured to form a network unit singly or in a plurality of the network service devices together, and in the case that a plurality of the network service devices form a network unit together, direct or indirect communication connection is established between the network service devices; each of said network service devices being assigned a device identification PID for identifying said network service device within said network element;
the receiver is configured to receive communication data from a client or a server or other network service devices, where the communication data includes a service request packet from the client and a service response packet from the server, where the service request packet and the service response packet include a service identifier s_info and a direction switch for distinguishing the service request packet from the service response packet, where the service identifier s_info includes at least one of a plurality of service function codes FID provided by the server, and also explicitly or implicitly includes the server identifier DID of the server and the device identifier PID of the network service device to which the server is connected, and the server identifier DID is used to identify the server that is communicatively connected to the network service device;
The receiver is further configured to submit the service request packet and a communication address peer_addr of a counterpart when receiving the service request packet to the request data processing module after identifying the type of the communication data according to the direction switch, and submit the service response packet to the response data processing module;
the request data processing module is used for generating a route record corresponding to the service identifier S_INFO and the peer_addr in the service request data packet, inserting or updating the route record in a return route table, and forwarding the service request data packet to the local service end according to the prompt of the service identifier S_INFO or forwarding the service request data packet to the optimal one of other connected and known network service devices so that the service request data packet is forwarded for a plurality of times and then sent to the service end;
the response data processing module is configured to search, in the return route table, for the route record that the service identifier s_info is identical to the service identifier s_info or that the service function code FID included in the service identifier s_info has an intersection with the service identifier s_info and is identical to other parts according to the service identifier s_info in the service response data packet, and forward the service response data packet to the peer_addr in the route record according to a search result.
CN201910052652.2A 2019-01-21 2019-01-21 Network communication system, method and device for data forwarding across communication protocols Active CN111464573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910052652.2A CN111464573B (en) 2019-01-21 2019-01-21 Network communication system, method and device for data forwarding across communication protocols

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910052652.2A CN111464573B (en) 2019-01-21 2019-01-21 Network communication system, method and device for data forwarding across communication protocols

Publications (2)

Publication Number Publication Date
CN111464573A CN111464573A (en) 2020-07-28
CN111464573B true CN111464573B (en) 2023-07-28

Family

ID=71680581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910052652.2A Active CN111464573B (en) 2019-01-21 2019-01-21 Network communication system, method and device for data forwarding across communication protocols

Country Status (1)

Country Link
CN (1) CN111464573B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818590B (en) * 2020-07-31 2022-08-30 隆胜(海南)科技有限公司 Wireless network path optimization method and device
CN116074365A (en) * 2021-11-01 2023-05-05 中兴通讯股份有限公司 Method and device for establishing connection, storage medium and electronic device
CN114911731B (en) * 2022-03-16 2023-11-17 平湖市智周深鉴智能科技有限公司 Modeling interface design method of complex system, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101095104A (en) * 2004-12-30 2007-12-26 三星电子株式会社 A terminal data format and a communication control system and method using the terminal data format
CN101132394A (en) * 2006-08-22 2008-02-27 华为技术有限公司 Method for confirming service user direction
CN101242413A (en) * 2008-01-30 2008-08-13 中国科学院计算技术研究所 Service resource address acquisition system and method in multi-layer NAT network under one root
CN104620556A (en) * 2012-09-11 2015-05-13 汤姆逊许可公司 Method and devices for registering a client to a server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017081906A1 (en) * 2015-11-11 2017-05-18 ソニー株式会社 Communication device and communication method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101095104A (en) * 2004-12-30 2007-12-26 三星电子株式会社 A terminal data format and a communication control system and method using the terminal data format
CN101132394A (en) * 2006-08-22 2008-02-27 华为技术有限公司 Method for confirming service user direction
CN101242413A (en) * 2008-01-30 2008-08-13 中国科学院计算技术研究所 Service resource address acquisition system and method in multi-layer NAT network under one root
CN104620556A (en) * 2012-09-11 2015-05-13 汤姆逊许可公司 Method and devices for registering a client to a server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Tatsuhiro Tsutsui等."Performance evaluation of partial deployment of Breadcrumbs in content oriented networks".《2012 IEEE International Conference on Communications (ICC)》.2012,全文. *

Also Published As

Publication number Publication date
CN111464573A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN107733670B (en) Forwarding strategy configuration method and device
CN111464573B (en) Network communication system, method and device for data forwarding across communication protocols
US9225641B2 (en) Communication between hetrogenous networks
EP2951953B1 (en) Method of managing zigbee network in the internet of things
CN100547976C (en) The method and apparatus that is used for identifying reverse path forwarding information
CN102710811B (en) Realize method and the switch of dhcp address safety distribution
CN102938794A (en) Address resolution protocol (ARP) message forwarding method, exchanger and controller
US7872971B2 (en) Gateway unit
JP6195014B2 (en) COMMUNICATION SYSTEM, COMMUNICATION METHOD, RELAY DEVICE, AND COMMUNICATION PROGRAM
US10904202B2 (en) Packet routing using a network device
CN108600107B (en) Flow matching method capable of customizing content field
EP2697957A1 (en) Flow routing protocol by querying a remote server
CN101729351B (en) Method and system for finding topology information, query request device and awaiting query device
CN105812257A (en) Business chain router management system and use method thereof
KR101899802B1 (en) An apparatus for constructing unified identification structure in future internet environments and the method by using the same
US20080144631A1 (en) Method and apparatus for discovering component in at least one sub-network
CN102594941B (en) Method for device access and device communication in building intercom system
CN109716310A (en) Server unit, transmitting device and program for content distribution system
JP2007272340A (en) Network device management method and device
CN109151086B (en) Message forwarding method and network equipment
CN108111414B (en) Label deployment method and device based on segment routing
CN101197788A (en) Method for client terminal acquiring configuration information of data base server in computer network
CN102045373B (en) Implementation method and system supporting capability of actively pushing data messages
CN104767686A (en) Routing information query method and device in ALT network
JPWO2015145953A1 (en) Communication terminal, communication method and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant