Message response method, device, equipment, storage medium and product

CN122601732APending Publication Date: 2026-08-18SHANGHAI QIYEYU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610877909.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]本申请的主要目的在于提供了一种消息响应方法、装置、设备、存储介质及产品,旨在解决即时通讯软件在网闸隔离环境下无法建立TCP长连接,无法维持实时消息通信的技术问题

Benefits of technology

[0024]本申请通过接收客户端发送的传输层协议请求,并将传输层协议请求转换为应用层协议请求,然后将应用层协议请求传输至第二适配器,以使第二适配器反馈基于应用层协议请求得到的应用层协议响应,第一适配器与第二适配器通过网闸隔离,再将应用层协议响应转换为传输层协议响应,并将传输层协议响应发送至客户端。本申请通过第一适配器基于建立的TCP长连接接收客户端上的即时通讯软件发送的传输层协议请求,并将传输层协议请求转换为应用层协议请求,然后通过网闸将应用层协议请求传输至第二适配器,第二适配器通过网闸反馈基于应用层协议请求得到的应用层协议响应,再将应用层协议响应转换为传输层协议响应,并通过已建立的TCP长连接返回至客户端,从而即时通讯软件能够在网闸隔离环境下建立TCP长连接,实现实时、可靠、高效的消息通信。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601732A_ABST
    Figure CN122601732A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of network communication, and discloses a message response method, device, equipment, storage medium and product. The application receives a transport layer protocol request sent by instant messaging software on a client based on an established TCP long connection through a first adapter, converts the transport layer protocol request into an application layer protocol request, then transmits the application layer protocol request to a second adapter through a gatekeeper, feeds back an application layer protocol response obtained based on the application layer protocol request through the gatekeeper, converts the application layer protocol response into a transport layer protocol response, and returns the transport layer protocol response to the client through the established TCP long connection, so that the instant messaging software can establish a TCP long connection in a gatekeeper isolation environment, and real-time, reliable and efficient message communication is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to a message response method, apparatus, device, storage medium, and product. Background Technology

[0002] In critical industries such as finance and energy, network environments typically employ network isolation technologies for physical isolation to ensure internal network security. Network isolation devices generally only allow application layer protocols such as Hypertext Transfer Protocol (HTTP) / Hypertext Transfer Protocol Secure (HTTPS) to pass through, while prohibiting transport layer protocols such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) from directly penetrating. However, instant messaging software often relies on persistent TCP connections to maintain real-time message communication, which presents a significant challenge in a network isolation environment. Summary of the Invention

[0003] The main purpose of this application is to provide a message response method, apparatus, device, storage medium and product, which aims to solve the technical problem that instant messaging software cannot establish TCP long connections and maintain real-time message communication in a network isolation environment.

[0004] To achieve the above objectives, this application provides a message response method applied to a first adapter, the message response method comprising the following steps: Receives a transport layer protocol request sent by the client and converts the transport layer protocol request into an application layer protocol request; The application layer protocol request is transmitted to the second adapter, so that the second adapter responds with an application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client.

[0005] Optionally, receiving a transport layer protocol request sent by a client and converting the transport layer protocol request into an application layer protocol request includes: Receive a transport layer protocol request sent by the client, and extract transport layer data from the transport layer protocol request; The transport layer data is parsed, and identification information is generated based on the obtained parsing information; Based on the identification information, the transport layer protocol request is converted into an application layer protocol request.

[0006] Optionally, parsing the transport layer data and generating identification information based on the obtained parsing information includes: The transport layer data is parsed to obtain parsed information; Extract key fields from the parsed information, and generate a first command identifier based on the key fields; The first serial number is generated using the snowflake algorithm, and the identification information is determined based on the first serial number and the first command identifier.

[0007] Optionally, converting the transport layer protocol request into an application layer protocol request based on the identification information includes: Obtain the first connection identifier for establishing a first transport layer protocol connection with the client; The first sequence number, the first command identifier, and the first connection identifier are stored in the application layer protocol header field, and the transport layer data is stored in the application layer protocol message body. An application layer protocol request is constructed based on the application layer protocol header fields and the application layer protocol message body.

[0008] Optionally, converting the application layer protocol response into a transport layer protocol response and sending the transport layer protocol response to the client includes: Extract the second connection identifier from the response header of the application layer protocol response; Search the first preset mapping table for the second transport layer protocol connection corresponding to the second connection identifier; The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client through the second transport layer protocol connection.

[0009] Optionally, the step of converting the application layer protocol response into a transport layer protocol response and sending the transport layer protocol response to the client via the second transport layer protocol connection includes: Extract the second sequence number and the second command identifier from the response header of the application layer protocol response; The second sequence number, the second command identifier, and the second transport layer protocol connection are matched to obtain the target transport layer protocol connection that has passed the match. The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client through the target transport layer protocol connection.

[0010] Optionally, transmitting the application layer protocol request to the second adapter, so that the second adapter feeds back an application layer protocol response based on the application layer protocol request, includes: Transmit the application layer protocol request to the second adapter; If no application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period, the process returns to transmitting the application layer protocol request to the second adapter and determining the current number of retries, until the new number of retries is less than the preset number and an application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period.

[0011] Furthermore, to achieve the above objectives, this application provides a message response method applied to a second adapter, the message response method comprising the following steps: Receive the application layer protocol request sent by the first adapter, and convert the application layer protocol request into a transport layer protocol request; The transport layer protocol request is sent to the service server, so that the service server responds with a transport layer protocol response based on the transport layer protocol request. The transport layer protocol response is converted into an application layer protocol response, and the application layer protocol response is transmitted to the first adapter.

[0012] Optionally, sending the transport layer protocol request to the service server, so that the service server responds with a transport layer protocol response based on the transport layer protocol request, includes: Extract the third connection identifier from the request header of the application layer protocol request; Determine the third transport layer protocol connection corresponding to the third connection identifier; The transport layer protocol request is sent to the service server through the third transport layer protocol connection, so that the service server can send back a transport layer protocol response based on the transport layer protocol request.

[0013] Optionally, determining the third transport layer protocol connection corresponding to the third connection identifier includes: Search the second preset mapping table for the initial transport layer protocol connection corresponding to the third connection identifier; If the initial transport layer protocol connection is valid, then the initial transport layer protocol connection is used as the third transport layer protocol connection; If the initial transport layer protocol connection is invalid, a third transport layer protocol connection is established with the service server.

[0014] Optionally, the step of converting the transport layer protocol response into an application layer protocol response and transmitting the application layer protocol response to the first adapter includes: Determine whether the transport layer protocol response is a single packet response; If so, the transport layer protocol response is converted into an application layer protocol response, and the application layer protocol response is transmitted to the first adapter; If not, the transport layer protocol response is converted into an application layer protocol response according to the response order of the transport layer protocol responses, and the application layer protocol response is transmitted to the first adapter.

[0015] Optionally, converting the transport layer protocol response into an application layer protocol response according to the response order of the transport layer protocol responses includes: Extract the third sequence number and the third command identifier from the response header of the transport layer protocol response; The transport layer protocol response is matched based on the third sequence number and the third command identifier to obtain a matching result; Based on the matching result and the response order of the transport layer protocol responses, the transport layer protocol responses are merged to obtain the merged transport layer protocol responses; The merged transport layer protocol response is converted into an application layer protocol response.

[0016] Furthermore, to achieve the above objectives, this application also provides a message response device applied to a first adapter, the message response device comprising: The first request conversion module is used to receive the transport layer protocol request sent by the client and convert the transport layer protocol request into an application layer protocol request. The first request transmission module is used to transmit the application layer protocol request to the second adapter, so that the second adapter can feed back the application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The first response conversion module is used to convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client.

[0017] Optionally, the first request conversion module is further configured to receive a transport layer protocol request sent by the client, and extract transport layer data from the transport layer protocol request; parse the transport layer data, and generate identification information based on the obtained parsing information; and convert the transport layer protocol request into an application layer protocol request based on the identification information.

[0018] Optionally, the first request conversion module is further configured to parse the transport layer data to obtain parsing information; extract key fields from the parsing information and generate a first command identifier based on the key fields; generate a first sequence number using the snowflake algorithm and determine identifier information based on the first sequence number and the first command identifier.

[0019] Furthermore, to achieve the above objectives, this application also provides a message response device applied to a second adapter, the message response device comprising: The second request conversion module is used to receive the application layer protocol request sent by the first adapter and convert the application layer protocol request into a transport layer protocol request. The second request transmission module is used to send the transport layer protocol request to the service server, so that the service server can send back a transport layer protocol response based on the transport layer protocol request; The second response conversion module is used to convert the transport layer protocol response into an application layer protocol response and transmit the application layer protocol response to the first adapter.

[0020] Optionally, the second request transmission module is further configured to extract a third connection identifier from the request header of the application layer protocol request; determine the third transport layer protocol connection corresponding to the third connection identifier; and send the transport layer protocol request to the service server through the third transport layer protocol connection, so that the service server can provide a transport layer protocol response based on the transport layer protocol request.

[0021] In addition, to achieve the above objectives, this application also proposes a message response device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the message response method as described above.

[0022] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the message response method described above.

[0023] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the message response method described above.

[0024] This application receives transport layer protocol requests sent by a client, converts these requests into application layer protocol requests, and then transmits them to a second adapter. The second adapter then sends an application layer protocol response based on the request. The first and second adapters are isolated by a network gateway. The application layer protocol response is then converted back into a transport layer protocol response and sent to the client. Alternatively, this application application layer protocol request is received by the first adapter via an established TCP long connection from the instant messaging software on the client. The first adapter converts the transport layer protocol request into an application layer protocol request, transmits it to the second adapter via the network gateway, and sends an application layer protocol response based on the request. This response is then converted back into a transport layer protocol response and sent back to the client via the established TCP long connection. This allows the instant messaging software to establish a TCP long connection in a network gateway-isolated environment, enabling real-time, reliable, and efficient message communication. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating the first embodiment of the message response method of this application; Figure 2 This is a flowchart illustrating the second embodiment of the message response method of this application; Figure 3 This is a flowchart illustrating the third embodiment of the message response method of this application; Figure 4 This is a flowchart illustrating the third embodiment of the message response method of this application; Figure 5 This is a flowchart illustrating the fifth embodiment of the message response method of this application; Figure 6 This is a schematic diagram of the overall architecture of an embodiment of the message response method of this application; Figure 7 This is an information flow diagram of one embodiment of the message response method of this application; Figure 8 This is a structural block diagram of the first embodiment of the message response device of this application; Figure 9This is a structural block diagram of the third embodiment of the message response device of this application; Figure 10 This is a schematic diagram of the structure of the message response device in the hardware operating environment involved in the embodiments of this application.

[0028] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0029] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0030] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0031] Based on this, embodiments of this application provide a message response method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the message response method of this application.

[0032] In this embodiment, the message response method includes the following steps: Step S10: Receive the transport layer protocol request sent by the client and convert the transport layer protocol request into an application layer protocol request.

[0033] It should be noted that the execution subject in this embodiment can be the first adapter, which can be an external network adapter, that is, an adapter deployed in the external network area, which can receive TCP connections from external network clients. The external network adapter corresponds to the internal network adapter.

[0034] Understandably, once the instant messaging software on the external network client is started, such as chat software or office software, the first adapter can establish a TCP long connection with the external network client, thereby being able to receive transport layer protocol requests sent by the external network client. The transport layer protocol request can be a TCP, UDP, or other request. The request header can include the connection identifier of the TCP long connection, and the request body can include business data sent by the user through the instant messaging software.

[0035] In practical implementation, transport layer protocols can be converted into application layer protocol requests, which can be HTTP / HTTPS requests, etc., thereby enabling the transport layer protocol requests to be encapsulated into a format that the gateway can transmit.

[0036] Step S20: Transmit the application layer protocol request to the second adapter so that the second adapter can provide an application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway.

[0037] Understandably, the second adapter can be an intranet adapter, i.e. an adapter deployed in the intranet area. The first and second adapters are physically isolated by a network gateway to ensure intranet security.

[0038] In a specific implementation, the application layer protocol request output by the first adapter can be transmitted to the second adapter through the network gateway. After receiving the application layer protocol request, the second adapter can send back the obtained application layer protocol response and transmit the application layer protocol response to the first adapter through the network gateway.

[0039] Step S30: Convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client.

[0040] It should be understood that after the first adapter receives the application layer protocol response transmitted by the second adapter through the network gateway, the first adapter can convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client through a TCP long connection. The client can then receive the transport layer protocol response obtained based on the transport layer protocol request.

[0041] In practical implementation, a protocol conversion engine can achieve bidirectional conversion between transport layer protocols and application layer protocols, including packet parsing, protocol encapsulation, and data format conversion. Protocol conversion maintains the characteristics of TCP long connections, avoiding the high latency issues caused by HTTP polling, reducing message transmission latency by more than 80%. No modifications to existing IM client and server code are required; protocol conversion is implemented through the adapter layer, resulting in simple deployment and low maintenance costs.

[0042] In this embodiment, all data is transmitted via HTTP, complying with the gateway's security policy, and supports HTTPS encryption to ensure data transmission security. It supports both TCP and HTTP protocol penetration, and can simultaneously handle IM message communication and business interface calls, meeting the needs of complex business scenarios.

[0043] This embodiment receives transport layer protocol requests sent by the client, converts them into application layer protocol requests, and then transmits the application layer protocol requests to the second adapter. The second adapter then sends an application layer protocol response based on the application layer protocol request. The first and second adapters are isolated by a network gateway. The application layer protocol response is then converted back into a transport layer protocol response and sent to the client. In this embodiment, the first adapter receives transport layer protocol requests sent by instant messaging software on the client based on an established TCP long connection, converts the transport layer protocol requests into application layer protocol requests, and then transmits the application layer protocol requests to the second adapter through the network gateway. The second adapter sends an application layer protocol response based on the application layer protocol request through the network gateway, converts the application layer protocol response back into a transport layer protocol response, and returns it to the client through the established TCP long connection. This allows the instant messaging software to establish a TCP long connection in a network gateway-isolated environment, achieving real-time, reliable, and efficient message communication.

[0044] refer to Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the message response method of this application.

[0045] Based on the first embodiment described above, in this embodiment, step S10 includes: Step S101: Receive the transport layer protocol request sent by the client, and extract transport layer data from the transport layer protocol request.

[0046] Understandably, after the first adapter receives the transport layer protocol request sent by the client, it can strip the protocol control information, such as the information stored in the request header, from the transport layer protocol request and retain only the pure business data as transport layer data for subsequent processing.

[0047] Step S102: Parse the transport layer data and generate identification information based on the obtained parsing information.

[0048] It should be understood that transport layer data can be parsed, and identification information can be generated based on the parsed information. The identification information can represent the identifier corresponding to the transport layer protocol request.

[0049] Furthermore, in order to effectively generate identification information, in this embodiment, step S102 includes: parsing the transport layer data to obtain parsed information; extracting key fields from the parsed information and generating a first command identifier based on the key fields; generating a first sequence number using the snowflake algorithm and determining the identification information based on the first sequence number and the first command identifier.

[0050] Understandably, the first adapter can parse the extracted raw byte stream data, i.e., transport layer data, and parse it into structured data that the program can understand, i.e. parsed information, such as an object or a dictionary, according to the application layer protocol agreed upon in advance between the client and the first adapter, thus completing the conversion from incomprehensible bytes to processable information.

[0051] It should be understood that key fields can be extracted from the parsed information to obtain specific fields that represent the business type, such as cmd, action, and type. These fields are then mapped and converted into an internally unified command identifier; for example, the first command identifier corresponding to the cmd field is 2. Simultaneously, the snowflake algorithm can be used to independently generate a globally unique numerical ID for the transport layer protocol request as the first sequence number. The first sequence number (seq) serves as the identification number for the transport layer protocol request, used for accurate matching of requests and responses, end-to-end log tracking, and preventing message replay. The first command identifier (cmd) serves as the business label for the transport layer protocol request, telling the system how to process it. Finally, the first sequence number and the first command identifier are used together as identification information.

[0052] Step S103: Convert the transport layer protocol request into an application layer protocol request based on the identification information.

[0053] Understandably, a transport layer protocol request can be converted into an application layer protocol request based on identification information, and the request header of the application layer protocol request can store identification information.

[0054] Furthermore, in order to effectively construct the application layer protocol request, in this embodiment, step S103 includes: obtaining a first connection identifier number for establishing a first transport layer protocol connection with the client; storing the first sequence number, the first command identifier, and the first connection identifier number in the application layer protocol header field, and storing the transport layer data in the application layer protocol message body; and constructing the application layer protocol request based on the application layer protocol header field and the application layer protocol message body.

[0055] It should be understood that after the external client starts, it can request the TCP connection port from the login center. The login center can return the TCP port that the first adapter is listening on to the client. The client can establish a long TCP connection with the first adapter through the TCP port. The first adapter assigns a unique connection ID, i.e., the first connection identifier, to each first transport layer protocol connection.

[0056] Understandably, the first sequence number, the first command identifier, and the first connection identifier can be stored in the application layer protocol header field, i.e., the request header; and the transport layer data can be stored in the application layer protocol message body, i.e., the request body; and then the application layer protocol request can be constructed based on the application layer protocol header field and the application layer protocol message body.

[0057] This embodiment receives a transport layer protocol request sent by a client, extracts transport layer data from the request, parses the transport layer data, generates identification information based on the parsed information, and then converts the transport layer protocol request into an application layer protocol request based on the identification information. This embodiment extracts transport layer data from the transport layer protocol request and generates identification information based on the parsed information, enabling the converted application layer protocol request to carry the identification information for subsequent TCP connection tracking.

[0058] refer to Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the message response method of this application.

[0059] Based on the above embodiments, in this embodiment, step S30 includes: Step S301: Extract the second connection identifier from the response header of the application layer protocol response.

[0060] Understandably, after the first adapter receives the application layer protocol response returned by the second adapter through the network gateway, it can extract the second connection identifier from the response header of the application layer protocol response. The second connection identifier can be consistent with the connection identifier requested by the transport layer protocol corresponding to the application layer protocol response.

[0061] Step S302: Search for the second transport layer protocol connection corresponding to the second connection identifier in the first preset mapping table.

[0062] It should be understood that the first preset mapping table can be a pre-set mapping relationship between TCP connection ID and TCP connection, that is, the mapping relationship between connection identifier and transport layer protocol connection. Therefore, the second transport layer protocol connection corresponding to the second connection identifier can be found from the first preset mapping table.

[0063] Step S303: Convert the application layer protocol response into a transport layer protocol response, and send the transport layer protocol response to the client through the second transport layer protocol connection.

[0064] In a specific implementation, the first adapter can convert the application layer protocol response into a transport layer protocol response, and send the transport layer response to the corresponding client through the second transport layer protocol connection. The transport layer protocol request and the transport layer protocol response are transmitted through the same TCP connection.

[0065] Further, in this embodiment, step S303 includes: extracting a second sequence number and a second command identifier from the response header of the application layer protocol response; matching the second sequence number and the second command identifier with the second transport layer protocol connection to obtain a target transport layer protocol connection that has passed the match; converting the application layer protocol response into a transport layer protocol response, and sending the transport layer protocol response to the client through the target transport layer protocol connection.

[0066] Understandably, after obtaining the second transport layer protocol connection corresponding to the second connection identifier, multiple requests may be waiting for a response on the same transport layer protocol connection simultaneously. In this case, the second sequence number and the second command identifier can be extracted from the response header of the application layer protocol response. Then, the second sequence number and the second command identifier are matched with the second transport layer protocol connection to obtain the target transport layer protocol connection that has passed the match. The sequence number in the response header of the transport layer protocol response corresponding to the target transport layer protocol connection is the aforementioned second sequence number, and the command identifier is the aforementioned second command identifier.

[0067] In a practical implementation, the application layer protocol response can be converted into a transport layer protocol response, and then the transport layer protocol response can be sent to the client through the target transport layer protocol connection.

[0068] Further, in this embodiment, step S20 includes: transmitting the application layer protocol request to the second adapter; if no application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period, then returning to transmitting the application layer protocol request to the second adapter, and determining the current number of retries, until the new number of retries is less than the preset number and an application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period.

[0069] It should be understood that this embodiment may employ a timeout retransmission mechanism. If the application layer protocol response is not received from the second adapter within a preset time after the first adapter transmits the application layer protocol request to the second adapter, the timeout retransmission mechanism needs to be enabled. At this time, the first adapter may retransmit the application layer protocol request to the second adapter and determine the current number of retries. The number of retries may be the number of times the application layer request is retransmitted to the second adapter.

[0070] In the specific implementation, if the new number of retries is less than the preset number and an application layer protocol response is received from the second adapter within the preset time, it indicates that the retransmission was successful after the timeout; if the new number of retries is greater than or equal to the preset number, it indicates that the transmission was abandoned after multiple timeouts. The preset number of retries and the preset time can be dynamically adjusted according to the network status.

[0071] This embodiment extracts the second connection identifier from the response header of the application layer protocol response, then searches for the corresponding second transport layer protocol connection in a first preset mapping table, converts the application layer protocol response into a transport layer protocol response, and sends the transport layer protocol response to the client through the established second transport layer protocol connection. In this embodiment, the second connection identifier is first extracted from the response header of the application layer protocol response, and then the corresponding second transport layer protocol connection is found based on the second connection identifier, thus enabling the transport layer protocol response to be sent to the client through the established second transport layer protocol connection.

[0072] This application also provides a message response method, as described in the embodiments below. Figure 4 , Figure 4 This is a flowchart illustrating the fourth embodiment of the message response method of this application.

[0073] In this embodiment, the message response method includes the following steps: Step S40: Receive the application layer protocol request sent by the first adapter and convert the application layer protocol request into a transport layer protocol request.

[0074] It should be noted that the execution entity in this embodiment can be a second adapter, which can be an intranet adapter, i.e., an adapter deployed in the intranet area.

[0075] Understandably, the second adapter can receive application layer protocol requests sent by the first adapter through the network gateway and convert the application layer protocol requests into transport layer protocol requests.

[0076] Step S50: Send the transport layer protocol request to the service server so that the service server can respond with a transport layer protocol response based on the transport layer protocol request.

[0077] It should be understood that transport layer protocol requests can be sent to the intranet business server via a TCP connection, and the intranet business server can process the transport layer protocol requests and return transport layer protocol responses.

[0078] Step S60: Convert the transport layer protocol response into an application layer protocol response, and transmit the application layer protocol response to the first adapter.

[0079] In a specific implementation, the second adapter can convert the transport layer protocol response into an application layer protocol response and transmit the application layer protocol response to the first adapter through a network gateway.

[0080] In this embodiment, the external network adapter includes a TCP server: listening on a specified port, receiving TCP connection requests from external network clients, and maintaining a connection pool; an HTTP client: converting TCP packets into HTTP requests, supporting functions such as timeout retry and connection reuse; a protocol converter: implementing the conversion of TCP packets into HTTP requests, including data serialization, compression, encryption, and other processing; an ACK manager: maintaining a queue of pending acknowledgment packets and handling timeout retransmission logic; and a connection mapping table: storing the mapping relationship between TCP connection IDs and HTTP sessions. The internal network adapter includes an HTTP server: receiving HTTP requests sent by the external network adapter and parsing request parameters; a TCP client: maintaining a TCP connection pool with the internal network business server and supporting connection reuse; a protocol converter: implementing the conversion of HTTP requests into TCP packets, including data deserialization, decompression, decryption, and other processing; a multi-packet processor: handling multi-packet response scenarios, caching and merging packets sequentially; and a response generator: converting TCP responses into HTTP responses and supporting streaming transmission.

[0081] In this embodiment, an application layer protocol request is received from a first adapter and converted into a transport layer protocol request. The transport layer protocol request is then sent to a service server, which responds with a transport layer protocol response based on the request. This response is then converted into an application layer protocol response and transmitted back to the first adapter. Alternatively, a second adapter receives the application layer protocol request from the first adapter, converts it into a transport layer protocol request, and sends it to the service server via a TCP connection. The service server returns a transport layer protocol response based on the request, which is then converted back into an application layer protocol response by the second adapter and transmitted to the first adapter via a network gateway.

[0082] refer to Figure 5 , Figure 5 This is a flowchart illustrating the fifth embodiment of the message response method of this application.

[0083] Based on the fourth embodiment described above, in this embodiment, step S50 includes: Step S501: Extract the third connection identifier from the request header of the application layer protocol request.

[0084] Understandably, after the second adapter receives the application layer protocol request sent by the first adapter, it can extract the TCP connection ID, i.e., the third connection identifier, from the request header of the application layer protocol request.

[0085] Step S502: Determine the third transport layer protocol connection corresponding to the third connection identifier.

[0086] Furthermore, in order to effectively locate the third transport layer protocol connection corresponding to the third connection identifier, in this embodiment, step S502 includes: searching for the initial transport layer protocol connection corresponding to the third connection identifier from the second preset mapping table; if the initial transport layer protocol connection is valid, then using the initial transport layer protocol connection as the third transport layer protocol connection; if the initial transport layer protocol connection is invalid, then establishing a third transport layer protocol connection with the service server.

[0087] It should be understood that the second preset mapping table may include a pre-set mapping relationship between TCP connection IDs and TCP connections, so the initial transport layer protocol connection corresponding to the third connection identifier can be found from the second preset mapping table.

[0088] Understandably, it's possible to determine whether the initial transport layer protocol (TLP) connection is valid, specifically whether an initial TLP connection exists. If the initial TLP connection is valid, it's directly used as the third TLP connection; if the initial TLP connection is invalid, a new third TLP connection is established on the internal network service server.

[0089] Step S503: Send the transport layer protocol request to the service server through the third transport layer protocol connection, so that the service server can send back a transport layer protocol response based on the transport layer protocol request.

[0090] In a practical implementation, a transport layer protocol request can be sent to the business server via a third transport layer protocol connection, and the business server can return a transport layer protocol response based on the transport layer protocol request.

[0091] Further, in this embodiment, step S60 includes: Step S601: Determine whether the transport layer protocol response is a single packet response.

[0092] Understandably, after the second adapter receives the transport layer protocol response returned by the intranet service server, it can determine whether the transport layer protocol response is a single packet response.

[0093] Step S602: If yes, the transport layer protocol response is converted into an application layer protocol response, and the application layer protocol response is transmitted to the first adapter.

[0094] It should be understood that if the transport layer protocol response is a single packet response, the transport layer protocol response can be directly converted into an application layer protocol response and transmitted to the first adapter.

[0095] Step S603: If not, convert the transport layer protocol response into an application layer protocol response according to the response order of the transport layer protocol responses, and transmit the application layer protocol response to the first adapter.

[0096] Understandably, if the transport layer protocol response is not a single packet response, but a multi-packet response, the data packets can be buffered according to the response order of the transport layer protocol responses until all packets are received, and then merged into a complete application layer protocol response, and the application layer protocol response is transmitted to the first adapter.

[0097] Furthermore, in order to convert multi-packet responses into application layer protocol responses, in this embodiment, the step of converting the transport layer protocol responses into application layer protocol responses according to the response order of the transport layer protocol responses includes: extracting a third sequence number and a third command identifier from the response header of the transport layer protocol responses; matching the transport layer protocol responses based on the third sequence number and the third command identifier to obtain a matching result; merging the transport layer protocol responses based on the matching result and the response order of the transport layer protocol responses to obtain a merged transport layer protocol response; and converting the merged transport layer protocol response into an application layer protocol response.

[0098] It should be understood that the third sequence number and third command identifier can be extracted from the response header of the transport layer protocol response, and then the transport layer protocol response can be matched based on the third sequence number and third command identifier to obtain the matching result. The matching result can indicate which transport layer protocol request each transport layer protocol response is a reply to.

[0099] Understandably, since the business server may split a large response into multiple TCP packets for sending, the transport layer protocol responses corresponding to the same transport layer protocol request can be grouped into the same group. The second adapter can merge the transport layer protocol responses in the same group according to the response order of the transport layer protocol responses, that is, the order in which the data packets are received, to obtain the merged transport layer protocol response, and then convert the merged transport layer protocol response into the application layer protocol response.

[0100] In practice, it can monitor TCP connection status, data transmission success rate, latency and other indicators in real time, and automatically rebuild the connection and restore data transmission when the connection is abnormal.

[0101] In this embodiment, refer to Figure 6 , Figure 6 This is a schematic diagram of the overall architecture of an embodiment of the message response method of this application, as shown below. Figure 6As shown, the Client is an external network client. After the client's instant messaging software starts, it can obtain a TCP connection port from the login center of the Nginx service on the external network server. The Nginx service is a proxy static resource service. The client can then connect to the Adapter service on the external network server through the obtained TCP connection port. Adapter-server represents the external network adapter. The external network adapter can convert TCP data into HTTP requests and forward them to the Adapter service on the internal network server through the network gateway. Adapter-server represents the internal network adapter. The internal network adapter can obtain HTTP requests, convert them into TCP data, send them to Mobiled (the internal network business server), and return TCP packets. The internal network adapter converts the TCP data into HTTP requests and forwards them to the external network adapter. The external network adapter then returns TCP packets to the client. For static resources such as static web pages requested by the client, the Nginx service on the external network server can connect to the Nginx service on the internal network server and return the TCP port that the Adapter service is listening on. Then, the external Nginx service returns the request result of the Nginx proxy service to the client.

[0102] In this embodiment, refer to Figure 7 , Figure 7 This is an information flow diagram of one embodiment of the message response method of this application, such as... Figure 7 As shown, the external TCP proxy (TCP proxy): converts the TCP protocol to the HTTP protocol from the outside to the inside, routes it to the internal TCP proxy via the bus, and then converts the HTTP protocol back to the TCP protocol to interact with the internal TCP gateway; similarly, it performs the same operation when going from the inside to the outside to ensure normal TCP communication; the external HTTP proxy: when going from the outside to the inside, it proxies the Android mobile client's HTTP interface, converts the HTTP request according to the bus requirements, and after passing through the bus, it proxies it to the internal HTTP proxy, which converts the bus request back to the original request and interacts with the internal HTTP gateway; the external NGINX: static resources; requests cannot exceed 6 seconds, scheduled tasks cannot be written, the bus does not support TCP long connections, in case of a large number of abnormal requests, the bus will block registration information, the default HTTP method, the bus only supports POST requests, and the URL cannot contain parameters.

[0103] This embodiment extracts the third connection identifier from the request header of the application layer protocol request, then determines the third transport layer protocol connection corresponding to the third connection identifier, and sends the transport layer protocol request to the service server through the third transport layer protocol connection. The service server then responds with a transport layer protocol response based on the transport layer protocol request. It then determines whether the transport layer protocol response is a single-packet response. If so, the transport layer protocol response is converted into an application layer protocol response and transmitted to the first adapter. If not, the transport layer protocol responses are converted into application layer protocol responses according to the response order and transmitted to the first adapter. Alternatively, this embodiment uses a second adapter to send the transport layer protocol request to the service server through the third transport layer protocol connection, causing the service server to respond with a transport layer protocol response. It then determines whether the response is a single-packet response and converts it into an application layer protocol response based on the determination result. This approach can handle both single-packet and multi-packet response scenarios. The resulting application layer protocol response is then transmitted to the first adapter through a network gateway.

[0104] Reference Figure 8 , Figure 8 This is a structural block diagram of the first embodiment of the message response device of this application.

[0105] like Figure 8 As shown, the message response device proposed in this application embodiment is applied to a first adapter and includes: The first request conversion module 10 is used to receive a transport layer protocol request sent by the client and convert the transport layer protocol request into an application layer protocol request. The first request transmission module 20 is used to transmit the application layer protocol request to the second adapter, so that the second adapter can feed back the application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The first response conversion module 30 is used to convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client.

[0106] This embodiment receives transport layer protocol requests sent by the client, converts them into application layer protocol requests, and then transmits the application layer protocol requests to the second adapter. The second adapter then sends an application layer protocol response based on the application layer protocol request. The first and second adapters are isolated by a network gateway. The application layer protocol response is then converted back into a transport layer protocol response and sent to the client. In this embodiment, the first adapter receives transport layer protocol requests sent by instant messaging software on the client based on an established TCP long connection, converts the transport layer protocol requests into application layer protocol requests, and then transmits the application layer protocol requests to the second adapter through the network gateway. The second adapter sends an application layer protocol response based on the application layer protocol request through the network gateway, converts the application layer protocol response back into a transport layer protocol response, and returns it to the client through the established TCP long connection. This allows the instant messaging software to establish a TCP long connection in a network gateway-isolated environment, achieving real-time, reliable, and efficient message communication.

[0107] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In practical applications, those skilled in the art can select some or all of it to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0108] In addition, for technical details not described in detail in this embodiment, please refer to the message response method provided in any embodiment of this application, which will not be repeated here.

[0109] Based on the first embodiment of the message response device described in this application, a second embodiment of the message response device of this application is proposed.

[0110] In this embodiment, the first request conversion module 10 is further configured to receive a transport layer protocol request sent by the client, and extract transport layer data from the transport layer protocol request; parse the transport layer data, and generate identification information based on the obtained parsing information; and convert the transport layer protocol request into an application layer protocol request based on the identification information.

[0111] Furthermore, the first request conversion module 10 is also used to parse the transport layer data to obtain parsing information; extract key fields from the parsing information and generate a first command identifier based on the key fields; generate a first sequence number through the snowflake algorithm, and determine the identifier information based on the first sequence number and the first command identifier.

[0112] Furthermore, the first request conversion module 10 is also used to obtain a first connection identifier number for establishing a first transport layer protocol connection with the client; store the first sequence number, the first command identifier, and the first connection identifier number in the application layer protocol header field, and store the transport layer data in the application layer protocol message body; and construct an application layer protocol request based on the application layer protocol header field and the application layer protocol message body.

[0113] Furthermore, the first response conversion module 30 is also used to extract a second connection identifier from the response header of the application layer protocol response; search for the second transport layer protocol connection corresponding to the second connection identifier from the first preset mapping table; convert the application layer protocol response into a transport layer protocol response; and send the transport layer protocol response to the client through the second transport layer protocol connection.

[0114] Furthermore, the first response conversion module 30 is also configured to extract a second sequence number and a second command identifier from the response header of the application layer protocol response; match the second sequence number and the second command identifier with the second transport layer protocol connection to obtain a target transport layer protocol connection that has passed the match; convert the application layer protocol response into a transport layer protocol response, and send the transport layer protocol response to the client through the target transport layer protocol connection.

[0115] Furthermore, the first request transmission module 20 is also configured to transmit the application layer protocol request to the second adapter; if no application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period, the method of transmitting the application layer protocol request to the second adapter is returned, and the current number of retries is determined until the new number of retries is less than the preset number and an application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period.

[0116] Other embodiments or specific implementations of the message response device of this application can be found in the first to third method embodiments described above, and will not be repeated here.

[0117] Reference Figure 9 , Figure 9 This is a structural block diagram of the third embodiment of the message response device of this application.

[0118] like Figure 9 As shown, the message response device proposed in this application embodiment is applied to a second adapter and includes: The second request conversion module 40 is used to receive the application layer protocol request sent by the first adapter and convert the application layer protocol request into a transport layer protocol request. The second request transmission module 50 is used to send the transport layer protocol request to the service server, so that the service server can send back a transport layer protocol response based on the transport layer protocol request; The second response conversion module 60 is used to convert the transport layer protocol response into an application layer protocol response and transmit the application layer protocol response to the first adapter.

[0119] In this embodiment, an application layer protocol request is received from a first adapter and converted into a transport layer protocol request. The transport layer protocol request is then sent to a service server, which responds with a transport layer protocol response based on the request. This response is then converted into an application layer protocol response and transmitted back to the first adapter. Alternatively, a second adapter receives the application layer protocol request from the first adapter, converts it into a transport layer protocol request, and sends it to the service server via a TCP connection. The service server returns a transport layer protocol response based on the request, which is then converted back into an application layer protocol response by the second adapter and transmitted to the first adapter via a network gateway.

[0120] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In practical applications, those skilled in the art can select some or all of it to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0121] In addition, for technical details not described in detail in this embodiment, please refer to the message response method provided in any embodiment of this application, which will not be repeated here.

[0122] Based on the third embodiment of the message response device described above, a fourth embodiment of the message response device of this application is proposed.

[0123] In this embodiment, the second request transmission module 50 is further configured to extract a third connection identifier from the request header of the application layer protocol request; determine the third transport layer protocol connection corresponding to the third connection identifier; and send the transport layer protocol request to the service server through the third transport layer protocol connection, so that the service server can provide a transport layer protocol response based on the transport layer protocol request.

[0124] Furthermore, the second request transmission module 50 is also used to search for the initial transport layer protocol connection corresponding to the third connection identifier from the second preset mapping table; if the initial transport layer protocol connection is valid, then the initial transport layer protocol connection is used as the third transport layer protocol connection; if the initial transport layer protocol connection is invalid, then a third transport layer protocol connection is established with the service server.

[0125] Furthermore, the second response conversion module 60 is also used to determine whether the transport layer protocol response is a single packet response; if so, the transport layer protocol response is converted into an application layer protocol response and the application layer protocol response is transmitted to the first adapter; if not, the transport layer protocol response is converted into an application layer protocol response according to the response order of the transport layer protocol responses and the application layer protocol response is transmitted to the first adapter.

[0126] Furthermore, the second response conversion module 60 is also configured to extract a third sequence number and a third command identifier from the response header of the transport layer protocol response; match the transport layer protocol response based on the third sequence number and the third command identifier to obtain a matching result; merge the transport layer protocol responses based on the matching result and the response order of the transport layer protocol responses to obtain a merged transport layer protocol response; and convert the merged transport layer protocol response into an application layer protocol response.

[0127] Other embodiments or specific implementations of the message response device of this application can be found in the fourth to fifth method embodiments described above, and will not be repeated here.

[0128] This application provides a message response device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the message response method in Embodiment 1 above.

[0129] The following is for reference. Figure 10 The diagram illustrates a structural schematic of a message response device suitable for implementing embodiments of this application. The message response device in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10The message response device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0130] like Figure 10 As shown, the message response device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the message response device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the message response device to communicate wirelessly or wiredly with other devices to exchange data. Although message response devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0131] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0132] The message response device provided in this application, employing the message response method described in the above embodiments, can solve the technical problem that instant messaging software cannot establish a long TCP connection and maintain real-time message communication in a network isolation environment. Compared with the prior art, the beneficial effects of the message response device provided in this application are the same as those of the message response method provided in the above embodiments, and other technical features of this message response device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0133] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0134] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0135] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the message response method in the above embodiments.

[0136] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0137] The aforementioned computer-readable storage medium may be included in the message response device or may exist independently without being assembled into the message response device.

[0138] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a message response device, cause the message response device to: receive a transport layer protocol request sent by a client and convert the transport layer protocol request into an application layer protocol request; transmit the application layer protocol request to a second adapter so that the second adapter can feed back an application layer protocol response based on the application layer protocol request, wherein the first adapter and the second adapter are isolated by a network gateway; convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client.

[0139] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include object-oriented programming languages—such as Python, Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0141] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0142] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described message response method. This solves the technical problem that instant messaging software cannot establish TCP long connections and maintain real-time message communication in a network isolation environment. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the message response method provided in the above embodiments, and will not be repeated here.

[0143] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the message response method described above.

[0144] The computer program product provided in this application can solve the technical problem that instant messaging software cannot establish TCP long connections and maintain real-time message communication in a network isolation environment. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the message response method provided in the above embodiments, and will not be repeated here.

[0145] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included in the scope of protection of this application.

[0146] This application provides A1. A message response method applied to a first adapter, the message response method comprising the following steps: Receives a transport layer protocol request sent by the client and converts the transport layer protocol request into an application layer protocol request; The application layer protocol request is transmitted to the second adapter, so that the second adapter responds with an application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client.

[0147] A2. The message response method as described in A1, wherein receiving the transport layer protocol request sent by the client and converting the transport layer protocol request into an application layer protocol request includes: Receive a transport layer protocol request sent by the client, and extract transport layer data from the transport layer protocol request; The transport layer data is parsed, and identification information is generated based on the obtained parsing information; Based on the identification information, the transport layer protocol request is converted into an application layer protocol request.

[0148] A3. The message response method as described in A2, wherein parsing the transport layer data and generating identification information based on the obtained parsing information includes: The transport layer data is parsed to obtain parsed information; Extract key fields from the parsed information, and generate a first command identifier based on the key fields; The first serial number is generated using the snowflake algorithm, and the identification information is determined based on the first serial number and the first command identifier.

[0149] A4. The message response method as described in A3, wherein converting the transport layer protocol request into an application layer protocol request based on the identification information includes: Obtain the first connection identifier for establishing a first transport layer protocol connection with the client; The first sequence number, the first command identifier, and the first connection identifier are stored in the application layer protocol header field, and the transport layer data is stored in the application layer protocol message body. An application layer protocol request is constructed based on the application layer protocol header fields and the application layer protocol message body.

[0150] A5. The message response method as described in A1, wherein converting the application layer protocol response into a transport layer protocol response and sending the transport layer protocol response to the client includes: Extract the second connection identifier from the response header of the application layer protocol response; Search the first preset mapping table for the second transport layer protocol connection corresponding to the second connection identifier; The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client through the second transport layer protocol connection.

[0151] A6. The message response method as described in A5, wherein converting the application layer protocol response into a transport layer protocol response and sending the transport layer protocol response to the client via the second transport layer protocol connection includes: Extract the second sequence number and the second command identifier from the response header of the application layer protocol response; The second sequence number, the second command identifier, and the second transport layer protocol connection are matched to obtain the target transport layer protocol connection that has passed the match. The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client through the target transport layer protocol connection.

[0152] A7. The message response method as described in any one of A1 to A6, wherein transmitting the application layer protocol request to the second adapter, so that the second adapter feeds back an application layer protocol response based on the application layer protocol request, includes: Transmit the application layer protocol request to the second adapter; If no application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period, the process returns to transmitting the application layer protocol request to the second adapter and determining the current number of retries, until the new number of retries is less than the preset number and an application layer protocol response based on the application layer protocol request is received from the second adapter within a preset time period.

[0153] This application also provides B8. A message response method applied to a second adapter, the message response method comprising the following steps: Receive the application layer protocol request sent by the first adapter, and convert the application layer protocol request into a transport layer protocol request; The transport layer protocol request is sent to the service server, so that the service server responds with a transport layer protocol response based on the transport layer protocol request. The transport layer protocol response is converted into an application layer protocol response, and the application layer protocol response is transmitted to the first adapter.

[0154] B9. The message response method as described in B8, wherein sending the transport layer protocol request to the service server, so that the service server responds with a transport layer protocol response based on the transport layer protocol request, includes: Extract the third connection identifier from the request header of the application layer protocol request; Determine the third transport layer protocol connection corresponding to the third connection identifier; The transport layer protocol request is sent to the service server through the third transport layer protocol connection, so that the service server can send back a transport layer protocol response based on the transport layer protocol request.

[0155] B10. The message response method as described in B9, wherein determining the third transport layer protocol connection corresponding to the third connection identifier includes: Search the second preset mapping table for the initial transport layer protocol connection corresponding to the third connection identifier; If the initial transport layer protocol connection is valid, then the initial transport layer protocol connection is used as the third transport layer protocol connection; If the initial transport layer protocol connection is invalid, a third transport layer protocol connection is established with the service server.

[0156] B11. The message response method as described in B8, wherein converting the transport layer protocol response into an application layer protocol response and transmitting the application layer protocol response to the first adapter includes: Determine whether the transport layer protocol response is a single packet response; If so, the transport layer protocol response is converted into an application layer protocol response, and the application layer protocol response is transmitted to the first adapter; If not, the transport layer protocol response is converted into an application layer protocol response according to the response order of the transport layer protocol responses, and the application layer protocol response is transmitted to the first adapter.

[0157] B12. The message response method as described in B11, wherein converting the transport layer protocol response into an application layer protocol response according to the response order of the transport layer protocol responses includes: Extract the third sequence number and the third command identifier from the response header of the transport layer protocol response; The transport layer protocol response is matched based on the third sequence number and the third command identifier to obtain a matching result; Based on the matching result and the response order of the transport layer protocol responses, the transport layer protocol responses are merged to obtain the merged transport layer protocol responses; The merged transport layer protocol response is converted into an application layer protocol response.

[0158] This application also provides C13. A message response device applied to a first adapter, the message response device comprising: The first request conversion module is used to receive the transport layer protocol request sent by the client and convert the transport layer protocol request into an application layer protocol request. The first request transmission module is used to transmit the application layer protocol request to the second adapter, so that the second adapter can feed back the application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The first response conversion module is used to convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client.

[0159] C14. The message response apparatus as described in C13, wherein the first request conversion module is further configured to receive a transport layer protocol request sent by a client, and extract transport layer data from the transport layer protocol request; parse the transport layer data, and generate identification information based on the obtained parsing information; and convert the transport layer protocol request into an application layer protocol request based on the identification information.

[0160] C15. The message response device as described in C14, wherein the first request conversion module is further configured to parse the transport layer data to obtain parsing information; extract key fields from the parsing information and generate a first command identifier based on the key fields; generate a first sequence number using the snowflake algorithm and determine identifier information based on the first sequence number and the first command identifier.

[0161] This application also provides D16. A message response device for use in a second adapter, the message response device comprising: The second request conversion module is used to receive the application layer protocol request sent by the first adapter and convert the application layer protocol request into a transport layer protocol request. The second request transmission module is used to send the transport layer protocol request to the service server, so that the service server can send back a transport layer protocol response based on the transport layer protocol request; The second response conversion module is used to convert the transport layer protocol response into an application layer protocol response and transmit the application layer protocol response to the first adapter.

[0162] D17. The message response apparatus as described in D16, wherein the second request transmission module is further configured to extract a third connection identifier from the request header of the application layer protocol request; determine the third transport layer protocol connection corresponding to the third connection identifier; and send the transport layer protocol request to the service server through the third transport layer protocol connection, so that the service server provides a transport layer protocol response based on the transport layer protocol request.

[0163] This application also provides E18. A message response device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of a message response method as described in any one of A1 to A7 or A8 to A12.

[0164] This application also provides F19. A storage medium, which is a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of a message response method as described in any one of A1 to A7 or A8 to A12.

[0165] This application also provides G20. A computer program product comprising a computer program that, when executed by a processor, implements the steps of a message response method as described in any one of A1 to A7 or A8 to A12.

Claims

1. A message response method, applied to a first adapter, characterized in that, The message response method includes the following steps: Receives a transport layer protocol request sent by the client and converts the transport layer protocol request into an application layer protocol request; The application layer protocol request is transmitted to the second adapter, so that the second adapter responds with an application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The application layer protocol response is converted into a transport layer protocol response, and the transport layer protocol response is sent to the client.

2. The message response method as described in claim 1, characterized in that, The step of receiving a transport layer protocol request sent by the client and converting the transport layer protocol request into an application layer protocol request includes: Receive a transport layer protocol request sent by the client, and extract transport layer data from the transport layer protocol request; The transport layer data is parsed, and identification information is generated based on the obtained parsing information; Based on the identification information, the transport layer protocol request is converted into an application layer protocol request.

3. The message response method as described in claim 2, characterized in that, The step of parsing the transport layer data and generating identification information based on the obtained parsing information includes: The transport layer data is parsed to obtain parsed information; Extract key fields from the parsed information, and generate a first command identifier based on the key fields; The first serial number is generated using the snowflake algorithm, and the identification information is determined based on the first serial number and the first command identifier.

4. A message response method, applied to a second adapter, characterized in that, The message response method includes the following steps: Receive the application layer protocol request sent by the first adapter, and convert the application layer protocol request into a transport layer protocol request; The transport layer protocol request is sent to the service server, so that the service server responds with a transport layer protocol response based on the transport layer protocol request. The transport layer protocol response is converted into an application layer protocol response, and the application layer protocol response is transmitted to the first adapter.

5. The message response method as described in claim 4, characterized in that, Sending the transport layer protocol request to the service server, so that the service server responds with a transport layer protocol response based on the transport layer protocol request, includes: Extract the third connection identifier from the request header of the application layer protocol request; Determine the third transport layer protocol connection corresponding to the third connection identifier; The transport layer protocol request is sent to the service server through the third transport layer protocol connection, so that the service server can send back a transport layer protocol response based on the transport layer protocol request.

6. A message response device, applied to a first adapter, characterized in that, The message response device includes: The first request conversion module is used to receive the transport layer protocol request sent by the client and convert the transport layer protocol request into an application layer protocol request. The first request transmission module is used to transmit the application layer protocol request to the second adapter, so that the second adapter can feed back the application layer protocol response based on the application layer protocol request. The first adapter and the second adapter are isolated by a network gateway. The first response conversion module is used to convert the application layer protocol response into a transport layer protocol response and send the transport layer protocol response to the client.

7. A message response device applied to a second adapter, characterized in that, The message response device includes: The second request conversion module is used to receive the application layer protocol request sent by the first adapter and convert the application layer protocol request into a transport layer protocol request. The second request transmission module is used to send the transport layer protocol request to the service server, so that the service server can send back a transport layer protocol response based on the transport layer protocol request; The second response conversion module is used to convert the transport layer protocol response into an application layer protocol response and transmit the application layer protocol response to the first adapter.

8. A message response device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the message response method as described in any one of claims 1 to 3 or 4 to 5.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the message response method as described in any one of claims 1 to 3 or 4 to 5.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the message response method as described in any one of claims 1 to 3 or 4 to 5.