Multi-communication protocol terminal access method and system based on single port

Through the collaborative work of terminal equipment and routing server and access server, single -port reuse multi -communication protocol access has been realized, and the problem of low multiple port reuse rates and waste of resources in existing technologies have been solved. Scalability.

CN119342120AInactive Publication Date: 2025-01-21东风悦享科技有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411529878.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, a single port only supports a single communication protocol, resulting in the inability to reuse the gateway port, and the waste of resources. Adding a new access port requires restarting the gateway, resulting in the loss of device communication data.

Method used

Send a super -text transmission protocol request to the routing server through the terminal device, obtain the identity token and access service address, establish the connection of the transmission control protocol president, and use the access server to decoding the information according to the application layer to realize the multi -communication protocols to achieve multiple communication protocols. Terminal access.

Benefits of technology

A single port reuse multi -communication protocol access has been implemented, the utilization rate of the gateway port resource is improved, the device communication data is lost caused by restarting the gateway, and the load capacity and scalability of the system are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342120A_ABST
    Figure CN119342120A_ABST
Patent Text Reader

Abstract

The invention provides a multi-communication protocol terminal access method based on a single port. The method comprises the following steps: step 1, a terminal device sends a hypertext transfer protocol request to a routing server; step 2, the routing server feeds back the identity token and the access service address to the terminal equipment; 3, the terminal equipment initiates transmission control protocol long connection to the access server; step 4, the terminal equipment initiates a hypertext transfer protocol request to the access server again, and sends the identity token and the successfully connected transmission control protocol tetrad; step 5, the access server inquires the equipment information and obtains corresponding application layer coding and decoding information; and step 6, the terminal device writes in data through the transmission control protocol long connection, and the access server reads the data and decodes the data through the obtained application layer coding and decoding information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of multi-communication protocol terminal access, and in particular to a method and system for multi-communication protocol terminal access based on a single port. Background Art

[0002] In the scenario where device terminals access the cloud, the device terminals need to conduct real-time two-way communication with the cloud, but different types of device terminals support different communication protocols. In order to be compatible with the access of different device terminals, the cloud needs to introduce a gateway between all device terminals and the cloud to translate and forward the communication data between the two. First, the communication data formats of different types of device terminals are translated into the same data format that the cloud can process, and second, the communication data sent from the cloud to the device terminal is translated into a format that each device terminal can parse. When the gateway supports device terminals accessed by multiple communication protocols, a separate transport layer port needs to be provided for each device terminal in order to isolate and match different communication protocols used during access through different ports. This paper proposes a gateway solution that reuses a transport layer port to achieve access by multiple communication protocols. Summary of the invention

[0003] In view of this, the present invention provides a method and system for multi-communication protocol terminal access based on a single port to solve the technical problem in the prior art that a single port only supports a single communication protocol, resulting in the inability to reuse the gateway port.

[0004] A method for multi-communication protocol terminal access based on a single port, the method comprising: step 1, the terminal device sends a hypertext transfer protocol request to a routing server, the hypertext transfer protocol request includes the identity information of the terminal device; step 2, the routing server performs verification according to the identity information, and after the verification is passed, feeds back the identity token and the access service address to the terminal device; step 3, after the terminal device receives the access service address, it initiates a transmission control protocol long connection to the access server; step 4, after the transmission control protocol long connection is successful, the terminal device again initiates a hypertext transfer protocol request to the access server, and sends the identity token and the transmission control protocol four-tuple of successful connection; step 5, after the access server verifies the identity token, it queries the corresponding device information according to the transmission control protocol four-tuple, and then obtains the corresponding application layer codec information according to the device information; step 6, the terminal device writes data through the transmission control protocol long connection, and after the access server reads the data, it decodes the data according to the obtained application layer codec information, thereby obtaining the decoded data information.

[0005] Furthermore, the method also includes: Step 0, registering the application layer codec information corresponding to the newly added terminal device in the routing server for later use.

[0006] Furthermore, the step 5 includes: step 51, after the access server receives the identity token and transmission control protocol quadruple sent by the terminal device, the identity token is verified; step 52, after the verification is passed, the transmission control protocol quadruple is mapped to the target connection identification device information, so that the device information corresponds to the transmission control protocol quadruple; step 53, according to the device information, the application layer codec information of the corresponding terminal device registered in advance in the routing service is obtained.

[0007] Furthermore, the routing server feeds back the access service address to the terminal device, specifically: the routing server returns the access service address according to the existing load condition of the access server.

[0008] Furthermore, the method also includes: step 7, when the number of terminal devices connected increases, the routing server dynamically expands horizontally to improve the load capacity of the gateway.

[0009] Furthermore, the transmission control protocol quadruple includes a destination address, a destination port number, a source address, and a source port number.

[0010] The present invention also provides a system for multi-communication protocol terminal access based on a single port, the system comprising: a terminal device, used to send a hypertext transfer protocol request to a routing server, and after receiving an access service address, initiate a transmission control protocol long connection to the access server, and after the transmission control protocol long connection is successful, initiate a hypertext transfer protocol request to the access server again, and send an identity token and a transmission control protocol four-tuple of successful connection, and write data through the transmission control protocol long connection; a gateway, including an access server and a routing server, connected to the terminal device, wherein: the access server is used to verify that the identity token is passed, query the corresponding device information according to the transmission control protocol four-tuple, and then obtain the corresponding application layer encoding and decoding information according to the device information, and after reading the data written by the terminal device, decode the data through the obtained application layer encoding and decoding information, thereby obtaining the decoded data information; the routing server is used to perform verification according to the identity information, and after the verification is passed, feedback the identity token and the access service address to the terminal device.

[0011] Furthermore, the routing server is also used to register application layer codec information corresponding to the newly added terminal device for later use.

[0012] Furthermore, the routing server is also used to dynamically expand horizontally when the number of terminal devices connected increases, so as to improve the responsibility capacity of the gateway.

[0013] Furthermore, the transmission control protocol quadruple includes a destination address, a destination port number, a source address, and a source port number.

[0014] The present invention provides a method and system for multi-communication protocol terminal access based on a single port. The technical solution obtains an identity token and an access server address through a routing server through a terminal device, establishes a long transmission control connection with the access server, and then writes data. The access server then decodes the written data according to the application layer encoding and decoding information, thereby obtaining the decoded information for communication with the cloud. The present invention solves the technical problems of low gateway port utilization, waste of resources, and the need to restart the gateway to add a new access port, resulting in loss of device communication data. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram of a system for multi-communication protocol terminal access based on a single port provided by the present invention; Figure 2 It is a schematic flow chart of a method for terminal access of multiple communication protocols based on a single port provided by the present invention; Figure 3 It is a specific process schematic diagram of step 5 provided by the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0017] Device Item Example: The present invention provides a system for accessing multiple communication protocols terminals based on a single port, such as Figure 1 As shown, the system includes a terminal device and a gateway, wherein the gateway includes a routing server and an access server.

[0018] A terminal device is a hardware device connected to a computer or network system and supports the TCP / IP protocol. The TCP protocol (Transmission Control Protocol) is a connection-oriented, reliable, byte-stream-based transport layer protocol; the IP protocol (Internet Protocol) is a protocol designed for computer networks to communicate with each other. The TCP / IP protocol is not a protocol, but a general term for a protocol family, which includes the IP protocol, ICMP protocol, TCP protocol, as well as http, ftp, pop3, and https protocols. The terminal device is used to send a hypertext transfer protocol request to the routing server. After receiving the access service address, it initiates a transmission control protocol long connection to the access server. After the transmission control protocol long connection is successful, it initiates a hypertext transfer protocol request to the access server again, and sends an identity token and a successful transmission control protocol quadruple to write data through the transmission control protocol long connection. The transmission control protocol long connection is a TCP long connection. When TCP protocol is used for network communication, a connection must be established between the server and the client before the actual read and write operation. After completing a read and write operation, the connection between them will not be closed actively, and subsequent read and write operations will continue to use this connection. This is a TCP long connection. The hypertext transfer protocol request, or http request, is a series of data sent from the client to the server, mainly including three parts: request line, request header, and request body.

[0019] A gateway is also called an internetwork connector or protocol converter. It realizes network interconnection above the network layer. It is a complex network interconnection device that is only used for interconnection between two networks with different high-level protocols. The gateway includes an access server (Access Service) and a routing server (Router Service), which are connected to the terminal device.

[0020] After the access server verifies that the identity token has passed, it queries the corresponding device information according to the transmission control protocol quadruple, and then obtains the corresponding application layer codec information according to the device information. After reading the data written by the terminal device, it decodes the data through the obtained application layer codec information to obtain the decoded data information. The access server provides device identity authentication services and provides a custom application layer communication protocol access service based on TCP. The identity token is an authorized identity token that the user uses the device identity information to exchange, and then takes the identity token to the access service for identity authentication. Only a legal identity token can be authenticated. The transmission control protocol quadruple, that is, the TCP quadruple, includes the target address, target port number, source address, and source port number, which can uniquely identify a connection. The application layer codec information is the information in the application layer communication protocol (Application Layer Communication Protocol, which defines how application processes running on different end systems transmit messages to each other). The mapping device that supports converting different application layer communication protocols into the same application layer communication protocol is a multi-protocol gateway. The mainstream solution for existing devices to communicate with multi-protocol gateways is that one communication protocol uses a single port for input, and multiple protocols use multiple ports to provide support. This solution has prominent disadvantages and obvious limitations on usage scenarios. With the access of a large number of more and more types of communication protocols, the number of ports will expand. The data of the gateway's open ports will continue to expand as the number of communication protocols supported for access increases. Port resources are a scarce resource, and this solution wastes resources. The gateway design architecture provided by the present invention can effectively avoid this problem while solving the above-mentioned needs.

[0021] The routing server is used to perform verification based on the identity information, and after the verification is passed, the identity token and access service address are fed back to the terminal device. In addition to providing device authorization and access service address query functions, the routing server can also realize load balancing of access services. When the number of terminal device accesses increases, the routing server can dynamically expand horizontally to improve the responsibility of the gateway. The routing server is also used to register the application layer encoding and decoding information corresponding to the newly added terminal device for later use. The prior art does not support hot addition of communication protocols. Each time a new communication protocol is added, it is necessary to stop the gateway service and add a new access port for mapping the newly added communication protocol. The large number of long connections managed by the gateway service and frequent restarts will lead to the loss of device communication data. The multi-protocol gateway design architecture provided by the present invention uses one port to implement a multi-protocol communication gateway, supports a variety of different devices to access the gateway using different communication protocols, thereby greatly improving the utilization of port resources.

[0022] Method Item Example: The present invention provides a method for accessing a multi-communication protocol terminal based on a single port, such as Figure 2 As shown, the method steps are as follows.

[0023] Step 0: Register the application layer codec information corresponding to the newly added terminal device to the routing server for later use.

[0024] On the basis of supporting multi-protocol access, when the access communication protocol needs to be increased, there is no need to add the corresponding port. You only need to enter the new device information and codec information into the routing service, and the routing service will send it to the access service. There is no need to restart the gateway to avoid abnormal disconnection of long device connections caused by restarting the gateway. In addition, the same port can be reused to support multiple application layer communication protocols, improving the utilization of gateway port resources.

[0025] Step 1: The terminal device sends a hypertext transfer protocol request to the routing server, where the hypertext transfer protocol request includes identity information of the terminal device; The terminal device initiates an HTTP request to the routing service with the device identity information, and the routing server verifies its identity information.

[0026] Step 2: The routing server verifies the identity information and sends the identity token and access service address to the terminal device after verification. The routing server feeds back the access service address to the terminal device, specifically: the routing server returns the access service address according to the existing load of the access server. Therefore, the routing server returns the identity token when the identity token verification is passed, and returns the address of the access service at the same time. When returning the access service address, it returns a suitable access service instance address according to the existing load of the access service.

[0027] Step 3: After receiving the access service address, the terminal device initiates a transmission control protocol long connection to the access server; After receiving the access service address, the terminal device initiates a TCP persistent connection to the access server.

[0028] Step 4, after the TCP long connection is successful, the terminal device initiates a HTTP request to the access server again, and sends an identity token and a TCP quadruple indicating a successful connection; After the terminal device successfully initiates a TCP long connection, it initiates a request to the access service again through the http protocol, carrying the identity token and the TCP four-tuple (destination IP, destination port number, source IP, source port number) of the successful connection.

[0029] Step 5: After the access server verifies the identity token, it queries the corresponding device information according to the transmission control protocol quadruple, and then obtains the corresponding application layer codec information according to the device information; After receiving the identity token carried by the terminal device, the access service verifies whether the token is legitimate. After the verification is passed, the TCP four-tuple is mapped to the target connection identification device information and the application layer codec information of the device pre-registered in the routing service is queried. Figure 3 As shown, the specific process of this step is as follows.

[0030] Step 51, after receiving the identity token and the transmission control protocol quadruple sent by the terminal device, the access server verifies the identity token; Step 52, after verification, the transmission control protocol quadruple is mapped to the target connection identification device information so that the device information corresponds to the transmission control protocol quadruple; The transmission control protocol quadruple includes a target address, a target port number, a source address, and a source port number.

[0031] Step 53: Acquire application layer codec information of the corresponding terminal device pre-registered in the routing service according to the device information.

[0032] Step 6: The terminal device writes data through the transmission control protocol long connection. After the access server reads the data, it decodes the data through the obtained application layer encoding and decoding information to obtain the decoded data information.

[0033] The device starts writing the corresponding data to the TCP connection. After the access service reads the data from the connection, it decodes it using the codec stack data of the connection identifier. At this point, the gateway completes the encoding and decoding of the custom application layer communication protocol data of the access device, realizing the translation and conversion of multiple protocols to a single protocol.

[0034] Step 7: When the number of terminal devices increases, the routing server dynamically expands horizontally to increase the load capacity of the gateway.

[0035] The routing service provides the ability to balance server loads, ensuring that gateway nodes can be dynamically and seamlessly expanded horizontally when the number of accesses increases, greatly improving the gateway's load capacity.

[0036] In summary, the present invention provides a method and system for multi-communication protocol terminal access based on a single port. The technical solution obtains an identity token and an access server address through a routing server through a terminal device, establishes a long transmission control connection with the access server, and then writes data. The access server then decodes the written data according to the application layer encoding and decoding information, thereby obtaining the decoded information for communication with the cloud. The present invention solves the technical problems of low gateway port utilization, waste of resources, and the need to restart the gateway to add a new access port, resulting in loss of device communication data.

[0037] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for multi-communication protocol terminal access based on a single port, characterized in that: The method comprises: Step 1: The terminal device sends a hypertext transfer protocol request to the routing server, where the hypertext transfer protocol request includes identity information of the terminal device; Step 2: The routing server verifies the identity information and sends the identity token and access service address to the terminal device after verification. Step 3: After receiving the access service address, the terminal device initiates a transmission control protocol long connection to the access server; Step 4, after the TCP long connection is successful, the terminal device initiates a HTTP request to the access server again, and sends an identity token and a TCP quadruple indicating a successful connection; Step 5: After the access server verifies the identity token, it queries the corresponding device information according to the transmission control protocol quadruple, and then obtains the corresponding application layer codec information according to the device information; Step 6: The terminal device writes data through the transmission control protocol long connection. After the access server reads the data, it decodes the data through the obtained application layer encoding and decoding information to obtain the decoded data information.

2. According to claim 1, a method for multi-communication protocol terminal access based on a single port, characterized in that: The method further comprises: Step 0: Register the application layer codec information corresponding to the newly added terminal device to the routing server for later use.

3. According to claim 2, a method for multi-communication protocol terminal access based on a single port, characterized in that: The step 5 comprises: Step 51, after receiving the identity token and the transmission control protocol quadruple sent by the terminal device, the access server verifies the identity token; Step 52, after verification, the transmission control protocol quadruple is mapped to the target connection identification device information so that the device information corresponds to the transmission control protocol quadruple; Step 53: Acquire application layer codec information of the corresponding terminal device pre-registered in the routing service according to the device information.

4. According to claim 1, a method for multi-communication protocol terminal access based on a single port, characterized in that: The routing server feeds back the access service address to the terminal device, specifically: the routing server returns the access service address according to the existing load condition of the access server.

5. The method for multi-communication protocol terminal access based on a single port according to claim 4, characterized in that: The method further comprises: Step 7: When the number of terminal devices increases, the routing server dynamically expands horizontally to increase the load capacity of the gateway.

6. The method for multi-communication protocol terminal access based on a single port according to claim 1, characterized in that: The transmission control protocol quadruple includes a target address, a target port number, a source address, and a source port number.

7. A system for implementing the method for single-port based multi-communication protocol terminal access according to claims 1-6, characterized in that: The system comprises: The terminal device is used to send a hypertext transfer protocol request to the routing server, initiate a transmission control protocol long connection to the access server after receiving the access service address, initiate a hypertext transfer protocol request to the access server again after the transmission control protocol long connection is successful, and send an identity token and a transmission control protocol quadruple indicating a successful connection, and write data through the transmission control protocol long connection; The gateway, including the access server and the routing server, is connected to the terminal device, wherein: After the access server verifies the identity token, it queries the corresponding device information according to the transmission control protocol quadruple, and then obtains the corresponding application layer codec information according to the device information. After reading the data written by the terminal device, it decodes the data through the obtained application layer codec information to obtain the decoded data information; The routing server is used to perform verification based on the identity information, and after the verification is passed, it feeds back the identity token and access service address to the terminal device.

8. A system for terminal access based on a single port with multiple communication protocols according to claim 7, characterized in that: The routing server is also used to register the application layer codec information corresponding to the newly added terminal device for later use.

9. A system for terminal access based on a single port with multiple communication protocols according to claim 7, characterized in that: The routing server is also used to dynamically expand horizontally when the number of terminal devices connected increases, so as to improve the responsibility capacity of the gateway.

10. A system for multi-communication protocol terminal access based on a single port according to claim 7, characterized in that: The transmission control protocol quadruple includes a target address, a target port number, a source address, and a source port number.

Citation Information

Patent Citations

  • Soft load balancing method and system supporting massive long connection

    CN106254377A

  • Cloud processing method based on C-V2X application layer message

    CN116782173A

  • Multi-protocol acquisition method of Internet of Things system

    CN117596313A

  • Data acquisition and distribution method and system and storage medium

    CN117615044A

  • Polymorphic network control system and method supporting mobile access of terminal

    US20240007929A1