Data communication method, device, system and equipment and storage medium

By establishing transmission control connections between network nodes and processing requests based on the correspondence between URLs and processing methods, the problems of low efficiency and poor security of the HTTP communication protocol in the existing technology are solved, and efficient and secure data communication is achieved.

CN118764525AInactive Publication Date: 2024-10-11SICHUAN MEDITATION SOFTWARE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411237298.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The Java enterprise application development efficiency based on the HTTP communication protocol in the existing technology is low, resulting in low communication efficiency between the client and the server, and there are security threats and connection management complexity issues.

Method used

By establishing transmission control connections between network nodes, multiple requests and responses are implemented, and the processing method is determined based on the correspondence between the URL and the processing method to improve data communication efficiency and security.

Benefits of technology

It improves the communication efficiency between the client and the server, enhances the reliability and security of data transmission, avoids disguise attacks, simplifies the communication design, and reduces the complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764525A_ABST
    Figure CN118764525A_ABST
Patent Text Reader

Abstract

The invention discloses a data communication method, device, system and equipment and a storage medium, and the method is applied to a first node, and comprises the steps: building a transmission control connection with a second node; receiving a first remote request from the second node over the transport control connection; the first remote request comprises a resource positioning identifier; determining a processing method matched with the first remote request according to the resource positioning identifier of the first remote request and the mapping relationship; the mapping relationship comprises a corresponding relationship between a plurality of different resource positioning identifiers and a plurality of different processing methods; and determining a response result of the first remote request based on the processing method, and sending the response result to the second node through the transmission control connection. According to the data communication method provided by the invention, before the network nodes access the data through the URL, the transmission control connection between the nodes is firstly established, so that different remote requests are respectively processed through the transmission control connection, and the data communication efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security communication, and specifically to a data communication method, apparatus, system, equipment and storage medium. Background Art

[0002] In order to simplify the development of Java enterprise applications, the prior art generally uses the Spring framework as a Java application development framework, and the existing Spring framework generally uses HTTP as a communication protocol.

[0003] Specifically, when the client communicates with the server based on the HTTP communication protocol, the server passively receives the client's data request and establishes a communication connection with the client in response to the data request. After the server returns the data request result to the client through the communication connection with the client, the communication connection between the server and the client is released immediately. In other words, each HTTP request under the HTTP communication protocol requires the establishment of a communication connection between the client and the server, resulting in low efficiency of data communication. Summary of the invention

[0004] In view of the above defects or deficiencies in the prior art, it is desirable to provide a data communication method, apparatus, system, device and storage medium. In the data communication method, before the network nodes access data through the URL, a transmission control connection is first established between the nodes. The nodes initiate URL requests and respond to URL requests through the transmission control connection, that is, a transmission control connection is established between the nodes once, which can realize multiple requests and responses. Compared with the method of initiating a URL request and establishing a communication connection based on the HTTP communication protocol, the method provided by the present application can greatly improve the communication efficiency. In addition, the processing method matching the URL in the remote request can be determined based on the correspondence between different URLs and different processing methods defined by each network node, so as to process the remote request, thereby improving the data communication efficiency.

[0005] In a first aspect, the present invention provides a data communication method, applied to a first node, the method comprising: establishing a transmission control connection with the second node; receiving a first remote request from a second node via a transmission control connection; the first remote request including a resource location identifier; Determining a processing method matched with the first remote request according to a resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; A response result of the first remote request is determined based on the processing method, and the response result is sent to the second node through the transmission control connection.

[0006] In a second aspect, the present invention provides a data communication method, applied to a second node, the method comprising: establishing a transmission control connection with the first node; Generate a first remote request, and send the first remote request to the first node through a transmission control connection; the first remote request includes a resource location identifier; A response result of the first remote request sent by the first node is received through the transmission control connection.

[0007] In a third aspect, the present invention provides a data communication device, applied to a first node, the device comprising: A first processing module, configured to establish a transmission control connection with a second node; A receiving module, configured to receive a first remote request from a second node via a transmission control connection; the first remote request includes a resource location identifier; A second processing module is used to determine a processing method matched with the first remote request according to a resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; The sending module is used to determine a response result of the first remote request based on the processing method, and send the response result to the second node through the transmission control connection.

[0008] In a fourth aspect, the present invention provides a data communication device, applied to a second node, the device comprising: A processing module, configured to establish a transmission control connection with the first node; A sending module, configured to generate a first remote request, and send the first remote request to the first node through a transmission control connection; the first remote request includes a resource location identifier; The receiving module is used to receive a response result of the first remote request sent by the first node through the transmission control connection.

[0009] In a fifth aspect, a data communication system is provided, comprising a first node and a second node; The first node establishes a transmission control connection with the second node; The second node generates a first remote request, and sends the first remote request to the first node through a transmission control connection; the first remote request includes a resource location identifier; The first node receives a first remote request from the second node through a transmission control connection; determines a processing method matching the first remote request according to a resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; determines a response result of the first remote request based on the processing method, and sends the response result to the second node through the transmission control connection; The second node receives a response result of the first remote request sent by the first node through the transmission control connection.

[0010] In a sixth aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first and second aspects is implemented.

[0011] In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, the method described in the first aspect and the second aspect is implemented.

[0012] Compared with the method in the prior art of initiating a URL request and establishing a communication connection based on the HTTP communication protocol, the data communication method, apparatus, system, device and storage medium provided in the embodiments of the present application, on the one hand, before the network nodes access data through the URL, first establish a transmission control connection between the nodes, and the nodes initiate URL requests and respond to URL requests through the transmission control connection. Establishing a transmission control connection between the nodes can realize multiple requests and responses, thereby greatly improving the communication efficiency; in addition, the processing method matching the URL in the remote request can be determined based on the correspondence between different URLs and different processing methods defined by each network node, so as to process the remote request, thereby improving the data communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 A schematic diagram of the architecture of a data communication system provided in an embodiment of the present application; Figure 2 A flow chart of a data communication method provided in an embodiment of the present application; Figure 3 A schematic diagram of the composition of an installation data package provided in an embodiment of the present application; Figure 4 A schematic diagram of a flow chart of another data communication method provided in an embodiment of the present application; Figure 5A schematic diagram of a flow chart of another data communication method provided in an embodiment of the present application; Figure 6 A schematic diagram of a flow chart of another data communication method provided in an embodiment of the present application; Figure 7 A schematic diagram of a flow chart of another data communication method provided in an embodiment of the present application; Figure 8 An interactive schematic diagram of a data communication system provided in an embodiment of the present application; Fig. 9 A block diagram of a data communication device provided in an embodiment of the present application; Fig.10 A block diagram of another data communication device provided in an embodiment of the present application; Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application; In the above picture: 100-data communication system; 101-first node; 102-second node; 301-secure communication module; 302-connection management module; 303-session management module; 304-encapsulation and parsing module; 305-request mapping module; 306-interceptor and global exception handling module; 307-external interface module; 900-first data communication device; 901-first processing module; 902-receiving module; 903-second processing module; 904-sending module; 1000-second data communication device; 1001-processing module block; 1002-sending module of the second data communication device; 1003-receiving module of the second data communication device; 1100-computer device; 1101-central processing unit (CPU); 1102-read only memory (ROM); 1103-random access memory (RAM); 1104-bus; 1105-input / output (I / O) interface; 1106-input part; 1107-output part; 1108-storage part; 1109-communication part; 1110-drive; 1111-removable medium. DETAILED DESCRIPTION

[0014] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0015] It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. In addition, the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects.

[0016] First, the terms involved in this application are explained as follows: (1) Spring Framework: is an open source Java platform that provides a programming and configuration model for building enterprise-level applications. The Spring Framework's automatic dependency management and scalability features enable rapid development of the Java language. (2) Client / Server architecture (C / S architecture for short): It is a computer network architecture model; this architecture mainly consists of two parts: client and server. The client is responsible for providing the user interface and interactive functions, while the server is responsible for processing tasks such as data storage, calculation and management. (3) Remote request: a request sent to other servers or resources on the network, such as a Hypertext Transfer Protocol request; (4) Hypertext Transfer Protocol (HTTP): a protocol for transmitting data between a client and a server. Specifically, a client can request a specific resource from a server and receive a response from the server. The specific resource may be, for example, a web page, an image, or a video. The client may be, for example, a web browser, and the server may be, for example, a web server. (5) Hypertext Transfer Protocol Secure (HTTPS): It is a security protocol that adds an encrypted transport layer to the HTTP protocol. Specifically, the HTTPS protocol uses the SSL (Secure Sockets Layer) or TLS (Transport Layer Security) protocol to encrypt data, ensuring data security and privacy protection during network transmission. (6) Transmission Control Protocol (TCP): a protocol used for connection; it implements reliable data transmission through steps such as connection establishment, data transmission, and connection release; (7) Uniform Resource Locator (URL): an address used to identify resources on the Internet. Nodes in the network can encapsulate the URL in a request to access the resource indicated by the URL, such as a web page, image, video, file, etc. For example, a node in the network can initiate an HTTP request based on the HTTP protocol, and the HTTP request includes a URL, which is used to access the resource indicated by the URL; (8) Session: refers to a series of related interactions between a single client and a Web server over a period of time.

[0017] In order to simplify the development of Java enterprise applications, the prior art generally uses the Spring framework as a Java application development framework, and the existing Spring framework generally uses HTTP as a communication protocol.

[0018] Specifically, when the HTTP communication protocol is applied to the C / S architecture, the server in the C / S architecture will not retain any information related to the client (including request information), that is, each time the client sends a request, the server regards it as an independent request, which makes it possible for attackers to intercept and tamper with the requests and responses between the client and the server by disguising the server, thereby making the communication between the client and the server vulnerable to security threats; secondly, when the HTTP communication protocol and the HTTPS communication protocol are applied to the C / S architecture, the server passively receives the client's data request, establishes a communication connection with the client in response to the data request, and releases the connection after the server responds to the data request, which results in the need to establish a communication connection between the client and the server for each HTTP request, resulting in low communication efficiency between the client and the server, and the server cannot timely transmit updated data or status to the client, so that the node status and data cannot be efficiently updated between the client and the server; finally, the HTTPS communication protocol is a one-way authentication, that is, it cannot guarantee that the network node that establishes the communication connection is the node that expects the communication connection, which results in poor security of the communication connection between the client and the server; in addition, the application of the HTTP communication protocol has certain limitations.

[0019] In order to solve the problems existing in the HTTP communication protocol or HTTPS communication protocol under the C / S architecture, the existing technology can adopt a new communication framework to realize data communication between the client and the server by using communication protocols such as TCP communication protocol which is different from the HTTP communication protocol or HTTPS communication protocol. However, this construction method requires a lot of reconstruction of existing codes, has a long development cycle and low efficiency. Secondly, the existing technology can also meet the communication needs by adding a communication intermediate layer, but this method increases the complexity of communication design and reduces communication performance.

[0020] Based on this, an embodiment of the present application provides a data communication method, whose technical principle is: before a network node accesses data through a URL, a transmission control connection is first established between the nodes, and then remote requests issued by the opposite node are received respectively based on the transmission control connection, so as to process different remote requests according to the correspondence between the resource location identifier and the processing method.

[0021] It should be noted that the transmission control connection established between the above nodes can maintain the status information of the connection, prevent attackers from intercepting and tampering with the requests and responses between the client and the server by disguising themselves as the server, so as to ensure the reliability of data transmission; and a transmission control connection established between nodes once can realize multiple requests and responses, so that both the client and the server can efficiently update the node status and data, thereby improving data communication efficiency.

[0022] Figure 1 The data communication method provided in the embodiment of the present application can be applied to the data communication system 100. Figure 1 The data communication system 100 includes a first node 101 and a second node 102. The first node 101 and the second node 102 may be a client and a server in a C / S architecture, respectively, and the first node 101 and the second node 102 are not limited to be a client or a server.

[0023] In the prior art, when the first node 101 is a client and the second node 102 is a server, the first node 101 can first establish a communication connection with the corresponding second node 102 according to the data request generated by itself, send the data request to the second node 102 based on the data communication connection, and release the data communication connection with the second node 102 after receiving the response result of the data request sent by the second node 102. That is, in the prior art, the communication connection between the first node 101 and the second node 102 is usually a "one-time" communication connection, which is only used to process a data request sent by the client.

[0024] In the embodiment of the present application, when the first node 101 is a client and the second node 102 is a server, the first node 101 or the second node 102 can first establish a data communication connection (for example, a transmission control connection) with the opposite node, and then transmit the data request generated by the own node to the opposite node, so that the opposite node receives and processes the data request. The data request transmitted by the first node 101 or the second node 102 to the opposite node can be, for example, a request for a web page, an image, or a video.

[0025] It should be noted that the first node 101 and the second node 102 can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0026] It should be noted that although the operations of the method of the present invention are described in a particular order in the drawings, this does not require or imply that the operations must be performed in this particular order or that all illustrated operations must be performed to achieve desired results.

[0027] The following will be combined Figure 1 The technical solution of the present application and how the technical solution of the present application solves the above technical problems are described in detail with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0028] The present application embodiment provides a data communication method, Figure 2 is a flow chart of a data communication method provided in an embodiment of the present application, and the data communication method can be applied to Figure 1 The first node 101 in the data communication system 100 shown in FIG. Figure 2 As shown, the method specifically comprises the following steps: Step 201 : establishing a transmission control connection with the second node 102 .

[0029] Compared with the prior art in which a data communication connection is established between the first node 101 and the second node 102 in response to an HTTP request generated by the first node 101, an embodiment of the present application can pre-establish a TCP connection between the first node 101 and the second node 102, thereby receiving and processing data requests based on a stable communication connection (i.e., a long connection) between the first node 101 and the second node 102; wherein the first node 101 can be a server and the second node 102 can be a client.

[0030] In a possible implementation, the first node 101 may establish a TCP connection with the second node 102 based on a preconfigured installation data packet.

[0031] Exemplarily, when the first node 101 is a server and the second node 102 is a client, the first node 101 and the second node 102 can respectively execute pre-configured installation data packets, so that the first node 101 configures its own listening port, the second node 102 configures its own connection port, and the first node 101 needs to establish a TCP connection.

[0032] Specifically, the second node 102 can first send a transmission control connection request (i.e., TCP connection request) data packet to the first node 101 that needs to establish a TCP connection through its own connection port; after the first node 101 receives the TCP connection request data packet through its own listening port, it replies to the second node 102 with a data packet agreeing to establish the TCP connection; finally, after the second node 102 receives the data packet agreeing to establish the TCP connection through its own connection port, it replies to the first node 101 with a data packet confirming the establishment of the TCP connection, to indicate that the TCP connection between the first node 101 and the second node 102 has been established.

[0033] For example, the above-mentioned TCP connection request data packet can be a synchronization data packet (Synchronization, referred to as SYN packet for short), the above-mentioned TCP connection establishment consent data packet can be a synchronization-confirmation data packet (Synchronization-Acknowledgement, referred to as SYN-ACK packet for short), and the above-mentioned TCP connection establishment confirmation data packet can be an confirmation data packet (Acknowledgement, referred to as ACK packet for short).

[0034] In a possible implementation, the installation data package may be a pre-configured software development kit.

[0035] For example, Figure 3 Schematic diagram of the composition of the installation data package provided in the embodiment of the present application, such as Figure 3 As shown, the installation data packet includes a secure communication module 301 .

[0036] Specifically, the secure communication module 301 may include configuration information of the first node 101 and the second node 102 to configure their own information when the first node 101 and the second node 102 respectively execute the installation data package.

[0037] Step 202: Receive a first remote request from the second node 102 via a transmission control connection; the first remote request includes a resource location identifier.

[0038] In a possible implementation, before receiving the remote request sent by the peer node, node authentication of the peer node may be implemented based on the transmission control connection established with the peer node.

[0039] Exemplarily, before receiving a first remote request from the second node 102 via a transmission control connection, the first node 101 sends a first communication key to the second node 102 via the transmission control connection, the first node 101 receives a second communication key sent by the second node 102 via the transmission control connection, and authenticates the second node 102 based on the second communication key; wherein the first communication key is used by the second node 102 to authenticate the first node 101; the first communication key and the second communication key may be the public keys of the first node 101 and the second node 102, respectively.

[0040] In an embodiment of the present application, before the first node 101 receives the first remote request sent by the peer end, based on the transmission control connection between the first node 101 and the second node 102, two-way authentication of the first node 101 and the second node 102 can be achieved by exchanging communication keys between the first node 101 and the second node 102, thereby improving the security of the data communication connection.

[0041] Exemplary, reference Figure 3 The secure communication module 301 may also configure a key pair for the first node 101 and the second node 102 respectively, so that the first node 101 and the second node 102 can achieve secure communication based on authentication of the key pair.

[0042] Specifically, the first node 101 can send a first communication key to the second node 102. When the private key inside the second node 102 can be used to decrypt the encrypted data of the first communication key, the first node 101 passes the security authentication of the second node 102. The first node 101 can also receive a second communication key sent by the second node 102. When the private key inside the first node 101 can be used to decrypt the encrypted data of the second communication key, the second node 102 passes the security authentication of the first node 101.

[0043] In a possible implementation, after the first node 101 establishes a transmission control connection with the second node 102 and passes a two-way authentication, the first node 101 may record the connection relationship with the second node 102 to facilitate subsequent communication connections.

[0044] Exemplary, reference Figure 3 The installation data packet may further include a connection management module 302. Specifically, the first node 101 and the second node 102 may respectively use the connection management module 302 to record the communication connection relationship with the opposite node.

[0045] Exemplarily, based on the connection management module 302 in the installation data package, it is also possible to determine whether the first node 101 and the second node 102 for which there is a communication connection record have established a communication connection, and generate a prompt message when the first node 101 or the second node 102 has not established a communication connection with the other end; secondly, when the communication connection established between the first node 101 and the second node 102 is disconnected, the connection management module 302 can also be configured to automatically remove the communication connection record between the first node 101 and the second node 102.

[0046] Step 203, determining a processing method matched with the first remote request according to the resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods.

[0047] In an embodiment of the present application, after receiving the first remote request, the processing method matching the first remote request can be quickly determined based on the correspondence between multiple different resource location identifiers and multiple different processing methods, thereby improving the response speed of each node to the data request.

[0048] Exemplarily, the resource location identifier included in the remote request may specifically be a uniform resource locator in a hypertext transfer protocol request.

[0049] In a possible implementation manner, a mapping relationship between a resource location identifier and a processing method may be generated based on parameter information of a plurality of different resource location identifiers in the installation data packet.

[0050] Exemplary, reference Figure 3 The installation data package may further include a request mapping module 305, which specifically includes a key-value correspondence table. The key-value correspondence table may be configured such that a resource location identifier (ie, key) and a processing method (ie, value) for processing the resource location identifier exist in a corresponding relationship.

[0051] Exemplarily, the request mapping module 305 may also include mapping annotation information of the resource location identifier, so as to use the mapping annotation information to determine a specific manner of mapping the resource location identifier to the corresponding processing method.

[0052] Specifically, when the first node 101 or the second node 102 obtains the installation data package, a mapping relationship between the resource location identifier and the processing method may be generated according to the mapping annotation information of the resource location identifier contained in the installation data package.

[0053] It should be noted that the development framework of the data communication system 100 in the embodiment of the present application is still the Spring framework. Therefore, when the first node 101 in the data communication system 100 executes the above-mentioned installation data package, the Spring framework can automatically scan the mapping annotation information of the resource location identifier in the installation data package based on its own service discovery mechanism, so that the first node 101 generates a mapping relationship between the resource location identifier and the processing method.

[0054] In the embodiment of the present application, a smooth migration from the HTTP protocol to the TCP protocol under the Spring framework can be achieved based on the installation data packet, thereby improving the communication performance while avoiding a large amount of code reconstruction.

[0055] Step 204: determine a response result of the first remote request based on the processing method, and send the response result to the second node 102 through the transmission control connection.

[0056] In a possible implementation, the first node 101 may execute a processing method corresponding to the resource location identifier based on the resource location identifier in the first remote request, thereby obtaining a response result of the first remote request.

[0057] Exemplarily, the first remote request can be parsed according to parameter information of the processing method to obtain parsing parameters corresponding to the first remote request; and the processing method is executed based on the parsing parameters to obtain a response result of the first remote request; wherein the parameter information of the processing method may include the parameter name of the processing method, parameter annotation mark, and parameter data type, etc.

[0058] Specifically, by using the request mapping module 305 in the installation data package, the processing method corresponding to the resource location identifier in the first remote request can be obtained according to the key-value correspondence table of the resource location identifier and the processing method generated by each node, so as to determine the parsing parameter corresponding to the first remote request based on the parameter information of the processing method, and thus process the first remote request based on the parsing parameter. Among them, the message content containing the resource location identifier can be in JSON format, for example; and when the parsing parameter is an object type, it can be directly deserialized into the corresponding object.

[0059] Exemplarily, after obtaining the response result of the first remote request, the response result may be packaged and sent to the second node 102 .

[0060] For example, refer to Figure 3 The installation data packet may further include an encapsulation and parsing module 304. Specifically, the encapsulation and parsing module 304 may be configured to encapsulate the response result into a filling message class including a session identifier and a timestamp according to the format and content of the response result, and encode the message into a byte stream to send to the peer node.

[0061] In a possible implementation, the response result of the first remote request may be verified based on the session identifier of the first remote request to improve the accuracy of the response result.

[0062] Exemplarily, the installation data package may be executed to assign a session identifier to the first remote request. Figure 3 The installation data packet may further include a session management module 303, which may generate session information according to a sending target of a data request and a content of a data request, and allocate a session identifier (ie, session ID) to each session information.

[0063] Exemplarily, the first remote request may carry a session identifier of the first remote request, and the response result of the first remote request may carry the session identifier of the first remote request. When the session identifier in the response result matches the session identifier of the first remote request, it can be determined that the response result is the response result of the first remote request.

[0064] Specifically, the session management module 303 can configure lock blocking for the second node 102 so that when the second node 102 receives a response result sent by the first node 101 through a transmission control connection, the session information (i.e., the response result of which remote request the response result specifically corresponds to) is confirmed according to the session identifier contained in the response result, thereby releasing the corresponding lock to receive the response result.

[0065] Exemplarily, the session management module 303 may also save the session information between the first node 101 and the second node 102; may connect to the corresponding nodes based on the communication connection record and send the session information; and may also remove the session when the session ends.

[0066] Compared with the method in the prior art of initiating a URL request and establishing a communication connection based on the HTTP communication protocol, the data communication method provided by the embodiment of the present application, on the one hand, before the network node accesses data through the URL, first establishes a transmission control connection between the nodes, and the nodes initiate URL requests and respond to URL requests through the transmission control connection. Establishing a transmission control connection between the nodes can realize multiple requests and responses, thereby greatly improving the communication efficiency; in addition, the processing method matching the URL in the remote request can be determined based on the correspondence between different URLs and different processing methods defined by each network node, so as to process the remote request, thereby improving the data communication efficiency.

[0067] In another embodiment of the present application, a specific implementation method for the first node 101 to determine the response result of the first remote request is also provided. Exemplarily, before executing the processing method corresponding to the resource location identifier, the interceptor in the interceptor list can be executed first, and then whether to execute the processing method can be determined according to the interceptor result.

[0068] Specifically, refer to Figure 3 The installation data package may also include an interceptor and a global exception handling module 306, which may be used to define an interceptor interface and an interceptor linked list, and to add an interceptor to a linked list method.

[0069] In another embodiment of the present application, other communication modes of the first node 101 are also provided. Exemplarily, Figure 4 is a flow chart of another data communication method provided in an embodiment of the present application, and the data communication method can still be applied to Figure 1 The first node 101 in the data communication system 100 shown in FIG. Figure 4 As shown, the method specifically comprises the following steps: Step 401, generating a second remote request, sending the second remote request to the second node 102 through a transmission control connection, where the second remote request carries a session identifier of the second remote request; Step 402: Receive a response result of a second remote request sent by the second node 102 through the transmission control connection.

[0070] The present application embodiment provides another data communication method. Figure 5 is a flow chart of another data communication method provided in an embodiment of the present application, which can be applied to Figure 1 The second node 102 in the data communication system 100 shown in FIG. Figure 5 As shown, the method specifically comprises the following steps: Step 501, establishing a transmission control connection with the first node 101; Step 502, generating a first remote request, and sending the first remote request to the first node through a transmission control connection; the first remote request includes a resource location identifier; Step 503: Receive a response result of the first remote request sent by the first node 101 through the transmission control connection.

[0071] Exemplarily, when a response result of the first remote request sent by the first node 101 is received, the response result may be decoded to obtain a session identifier, a timestamp, a URL, and a message content in the response result.

[0072] Specifically, the decoding of the above response result can be implemented based on the encapsulation and parsing module 304 in the installation data packet.

[0073] In another embodiment of the present application, other communication modes of the second node 102 are also provided. Exemplarily, Figure 6 is a flow chart of another data communication method provided in an embodiment of the present application, and the data communication method can still be applied to Figure 1 The second node 102 in the data communication system 100 shown in FIG. Figure 6 As shown, the method specifically comprises the following steps: Step 601, receiving a second remote request from the first node 101 through a transmission control connection; the second remote request includes a resource location identifier; Step 602, determining a processing parameter matched by the second remote request according to the resource location identifier of the second remote request and a mapping relationship; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; Step 603: determine a response result of the second remote request based on the processing method, and send the response result to the first node 101 through the transmission control connection.

[0074] It should be noted that the data communication between the first node 101 and the second node 102 may include the steps of generating a request, sending a request, processing a request, and sending a response result, which will not be described in detail here.

[0075] In another embodiment of the present application, other module distributions of the installation data package are also provided. Figure 3 The installation data package may further include an external interface module 307 .

[0076] Specifically, the external interface module 307 can provide a marking annotation interface for the first node 101 and the second node 102; can provide an annotation interface for the correspondence between resource location identifiers and processing methods; can provide an annotation interface for session sending methods; and can also provide an interceptor interface and a global exception handling interface.

[0077] In another embodiment of the present application, another data communication method is provided. Exemplarily, Figure 7 is a flow chart of another data communication method provided in an embodiment of the present application, which can be applied to Figure 1 The first node 101 or the second node 102 in the data communication system 100 shown. Figure 7 Taking the method applied to the first node 101 as an example, the method specifically includes the following steps: Step 701, establishing a transmission control connection with the second node 102; Step 702, receiving a remote request from the second node 102 via the transmission control connection; Step 703, verifying the remote request; Exemplarily, the remote request may be parsed to perform verification based on information such as a session identifier, a timestamp, or a message content in the parsing result.

[0078] Exemplarily, when the remote request verification passes, it indicates that the remote request is a valid request, and step 704 is executed; otherwise, the remote request is discarded.

[0079] Step 704, parsing the remote request and obtaining the resource location identifier in the remote request; Step 705a, executing a pre-configured installation data package; Step 705b, generating a mapping relationship between the resource location identifier and the processing method according to the mapping annotation information of the resource location identifier contained in the installation data packet; Step 705c, determining a processing method corresponding to the remote request based on the resource location identifier, and parsing the remote request according to parameter information of the processing method to obtain parsing parameters corresponding to the remote request; It should be noted that the embodiment of the present application sets the execution order of the above-mentioned steps 705a and 705b to be after step 704 in order to obtain the processing method corresponding to the data request after the first node 101 receives the valid data request from the second node 102. However, in actual applications, steps 705a and 705b can also be executed in any step before step 705c, and no specific restrictions are made here.

[0080] Step 706, determining a response result of the remote request based on the processing method determined in step 705c; Exemplarily, before executing the processing method, the interceptors in the interceptor list may be executed first, so that the processing method is executed when the interceptor result indicates that the processing method can be executed.

[0081] Step 707 , encapsulate the response result of the remote request and send it to the second node 102 .

[0082] In another embodiment of the present application, a specific interaction method of the data communication system 100 is also provided. Figure 8 is an interactive schematic diagram of a data communication system 100 provided in an embodiment of the present application, such as Figure 8 As shown, the first node 101 may be a server, and the second node 102 may be a client.

[0083] Exemplarily, the first node 101 can establish a transmission control connection with the second node 102, and receive a first remote request generated by the second node 102; then determine the processing method that matches the first remote request based on the resource location identifier and mapping relationship of the first remote request, so as to determine the response result of the first remote request based on the processing method and send it to the second node 102.

[0084] Exemplarily, the second node 102 may receive a response result of the first remote request sent by the first node 101 through the transmission control connection.

[0085] Exemplarily, the second node 102 may also receive a second remote request generated by the first node 101; and then determine a processing method for matching the second remote request based on the resource location identifier and mapping relationship of the second remote request, so as to determine a response result of the second remote request based on the processing method and send it to the first node 101.

[0086] Exemplarily, the first node 101 may also receive a response result of the second remote request sent by the second node 102 through the transmission control connection.

[0087] Fig. 9 A block diagram of a data communication device provided in an embodiment of the present application. Fig. 9 As shown, the first data communication device 900 is applied to the first node 101, including: a first processing module 901, a receiving module 902, a second processing module 903 and a sending module 904, wherein: A first processing module 901, configured to establish a transmission control connection with the second node 102; The receiving module 902 is configured to receive a first remote request from the second node 102 through a transmission control connection; the first remote request includes a resource location identifier; The second processing module 903 is used to determine the processing method matched with the first remote request according to the resource location identifier and the mapping relationship of the first remote request; the mapping relationship includes the correspondence between multiple different resource location identifiers and multiple different processing methods; The sending module 904 is used to determine a response result of the first remote request based on the processing method, and send the response result to the second node 102 through the transmission control connection.

[0088] Fig.10 Schematic diagram of another data communication device provided in an embodiment of the present application. Fig.10 As shown, the second data communication device 1000 is applied to the second node 102, including: a processing module 1001, a sending module 1002 of the second data communication device and a receiving module 1003 of the second data communication device, wherein: The processing module 1001 is configured to establish a transmission control connection with a first node; The sending module 1002 of the second data communication device is used to generate a first remote request and send the first remote request to the first node through the transmission control connection; the first remote request includes a resource location identifier; The receiving module 1003 of the second data communication device is used to receive a response result of the first remote request sent by the first node through the transmission control connection.

[0089] Reference below Fig.11 , Fig.11 A schematic diagram of the structure of a computer device suitable for implementing the embodiments of the present application is shown. Fig.11 As shown, the computer device 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103. In the random access memory (RAM) 1103, various programs and data required for the operation instructions of the system are also stored. The central processing unit (CPU) 1101, the read-only memory (ROM) 1102, and the random access memory (RAM) 1103 are connected to each other through a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0090] The following components are connected to the input / output (I / O) interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output (I / O) interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0091] In particular, according to an embodiment of the present application, the above reference flow chart Figure 2 , Figure 4~Figure 6Any of the described processes may be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product including a computer program carried on a computer-readable medium, the computer program including a program code for executing the method shown in the flowchart. In such an embodiment, the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present application are executed.

[0092] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium that matches a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operating instructions of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the aforementioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operating instruction, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The described units or modules may also be provided in a processor, for example, may be described as: a processor including a semantic extraction unit, a weight allocation unit, and a determination unit. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0095] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the computer device described in the above embodiment, or may exist independently without being installed in the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application. For example, it can be executed Figure 2 , Figure 4~Figure 6 The steps of any of the methods shown.

[0096] The present application embodiment provides a computer program product, which includes instructions. When the instructions are executed, the method described in the present application embodiment is executed. For example, Figure 2 , Figure 4~Figure 6 The steps of any of the methods shown.

[0097] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) by each other to form a technical solution.

Claims

1. A data communication method, characterized in that: Applied to the first node, the method comprises: establishing a transmission control connection with the second node; receiving a first remote request from the second node via the transmission control connection; the first remote request including a resource location identifier; Determining a processing method matched with the first remote request according to a resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; A response result of the first remote request is determined based on the processing method, and the response result is sent to the second node through the transmission control connection.

2. The data communication method according to claim 1, characterized in that: Before receiving the first remote request from the second node through the transmission control connection, the method further includes: The first node sends a first communication key to the second node through the transmission control connection, where the first communication key is used by the second node to authenticate the first node; The first node receives a second communication key sent by the second node through the transmission control connection, and authenticates the second node based on the second communication key.

3. The data communication method according to claim 1, characterized in that: The determining a response result of the first remote request based on the processing method specifically includes: Acquire parameter information of the processing method, parse the first remote request according to the parameter information of the processing method, and obtain parsed parameters of the first remote request; The processing method is executed based on the parsing parameters to obtain a response result of the first remote request.

4. The data communication method according to claim 1, characterized in that: The first remote request carries a session identifier of the first remote request.

5. The data communication method according to claim 1, characterized in that: The response result of the first remote request carries the session identifier of the first remote request.

6. The data communication method according to claim 1, characterized in that: The method further comprises: generating a second remote request, and sending the second remote request to the second node through the transmission control connection, wherein the second remote request carries a session identifier of the second remote request; A response result of the second remote request sent by the second node is received through the transmission control connection.

7. The data communication method according to claim 6, characterized in that: The receiving, through the transmission control connection, a response result of the second remote request sent by the second node, comprises: A response result sent by the second node is received through the transmission control connection, and if the session identifier in the response result matches the session identifier of the second remote request, it is determined that the response result is a response result of the second remote request.

8. A data communication method, characterized in that: Applied to the second node, the method comprises: establishing a transmission control connection with the first node; Generate a first remote request, and send the first remote request to the first node through the transmission control connection; the first remote request includes a resource location identifier; A response result of the first remote request sent by the first node is received through the transmission control connection.

9. The data communication method according to claim 8, characterized in that: The method further comprises: The installation data packet is executed to allocate a session identifier for the first remote request.

10. The data communication method according to claim 8, characterized in that: The method further comprises: receiving a second remote request from the first node via the transmission control connection; the second remote request includes a resource location identifier; Determine a processing method matched by the second remote request according to the resource location identifier and a mapping relationship of the second remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; the second remote request includes a resource location identifier; A response result of the second remote request is determined based on the processing method, and the response result is sent to the first node through the transmission control connection.

11. A data communication device, characterized in that: Deployed at a first node, the device comprises: A first processing module, configured to establish a transmission control connection with a second node; A receiving module, configured to receive a first remote request from the second node through the transmission control connection; the first remote request includes a resource location identifier; A second processing module, configured to determine a processing method matched to the first remote request according to a resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; A sending module is used to determine a response result of the first remote request based on the processing method, and send the response result to the second node through the transmission control connection.

12. A data communication device, characterized in that: Deployed at the second node, the device includes: A processing module, configured to establish a transmission control connection with the first node; a sending module, configured to generate a first remote request, and send the first remote request to the first node through the transmission control connection; the first remote request includes a resource location identifier; A receiving module is used to receive a response result of the first remote request sent by the first node through the transmission control connection.

13. A data communication system, characterized in that: including a first node and a second node; The first node establishes a transmission control connection with the second node; The second node generates a first remote request, and sends the first remote request to the first node through the transmission control connection; The first remote request includes a resource location identifier; The first node receives a first remote request from the second node through the transmission control connection; determines a processing method matching the first remote request according to a resource location identifier and a mapping relationship of the first remote request; the mapping relationship includes a correspondence between a plurality of different resource location identifiers and a plurality of different processing methods; determining a response result of the first remote request based on the processing method, and sending the response result to the second node through the transmission control connection; The second node receives a response result of the first remote request sent by the first node through the transmission control connection.

14. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Portal authentication method and system

    CN106789884A

  • Remote control method and device, electronic equipment and storage medium

    CN115589301A

  • Remote call request processing method and system and electronic equipment

    CN115866069A

  • Access authentication method and device, terminal and core network

    CN116132983A

  • Resource access method, computer equipment and computer readable storage medium

    CN118523966A