CN118233517A - Service multi-activity data access method, client, proxy service equipment and network communication system - Google Patents

Service multi-activity data access method, client, proxy service equipment and network communication system Download PDF

Info

Publication number
CN118233517A
CN118233517A CN202211650186.6A CN202211650186A CN118233517A CN 118233517 A CN118233517 A CN 118233517A CN 202211650186 A CN202211650186 A CN 202211650186A CN 118233517 A CN118233517 A CN 118233517A
Authority
CN
China
Prior art keywords
network connection
connection
network
tcp
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211650186.6A
Other languages
Chinese (zh)
Inventor
李腾岳
李魁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bairong Zhixin Beijing Technology Co ltd
Original Assignee
Bairong Zhixin Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bairong Zhixin Beijing Technology Co ltd filed Critical Bairong Zhixin Beijing Technology Co ltd
Priority to CN202211650186.6A priority Critical patent/CN118233517A/en
Publication of CN118233517A publication Critical patent/CN118233517A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a data access method, a client, proxy service equipment and a network communication system for multiple services. By responding to a request from a client to access the data: simultaneously initiating and establishing TCP network connection between the client and a plurality of servers; determining the TCP network connection which is the shortest connection establishment time as a first network connection; and executing the transmission of the data message between the client and the server by using the determined first network connection. Establishing a plurality of preemptive TCP connections through multi-machine room multi-activity service, and intelligently deciding to select an optimal network and an optimal link; in the face of large data clusters crossing machine rooms, the services are mutually called and accessed, and the services of the same machine room are preferentially accessed through decision TCP, so that transmission crossing the machine rooms is avoided.

Description

Service multi-activity data access method, client, proxy service equipment and network communication system
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a data access method, a client, a proxy service device, and a network communication system for multiple services.
Background
Big data are developed with a new date. In order to improve the service level, disaster recovery deployment measures such as ' two centers in one place ', ' three centers in two places ', ' and the like often occur in the financial field. The multi-activity data centers deployed by the disaster backup measures are all in operation, run the same application, have the same data, can provide the capacity of cross-center business load balancing operation, and realize continuous application availability and disaster backup capacity. Modes such as big data service double-activity, service multiple-activity and the like frequently relate to data transmission across machine rooms, and the inter-machine room communication is often realized through a network private line, however, the fast copying, the fast transmission, the fast operation and the like of the data of the multiple-activity machine room are hindered due to high cost of the network private line. Therefore, the upper limit of the bandwidth of the network private line between the machine rooms cannot be raised.
In the current big data operation, in order to avoid occupying the bandwidth of a private line crossing a machine room, the service in the machine room generally accesses the service program in the machine room through IP configuration, and is manually switched to the same-city machine room or a different-place machine room after the service program in the machine room is abnormal. Or a multi-machine room multi-service cluster is established, and the realization of multi-machine room service multi-activity in the true sense is abandoned. For example, when a big data job cluster a is deployed in an a machine room, a big data job cluster B is deployed in a B machine room, and whether the big data job is in the a machine room cluster or the B machine room cluster is manually configured and selected according to the service.
For the access data of the client, the connection multi-activity service machine room is strictly dependent on DNS (Domain NAME SYSTEM ) analysis, the optimal line and the shortest link machine room cannot be selected, and the connection multi-activity service machine room is dependent on the manual retry or the back-end retry of software such as Nginx after failure. Moreover, due to the uncertainty of the network and the nature of dynamic routing, after TCP breaks, the connection needs to be re-initiated and the transmission control protocol (TCP, transmission Control Protocol) re-tried repeatedly before the connection can be established and data re-transceived.
The description of the background art is only for the purpose of facilitating an understanding of the relevant art and is not to be taken as an admission of prior art.
Disclosure of Invention
According to an example embodiment of the present disclosure, a data access method, a client, a proxy service device, and a network communication system for multiple services are provided.
In a first aspect of the present disclosure, there is provided a data access method for service multiple activities, the method comprising:
in response to a request by a client to access the data:
Simultaneously initiating and establishing TCP network connection between the client and a plurality of servers;
determining the TCP network connection which is the shortest connection establishment time as a first network connection;
and executing the transmission of the data message between the client and the server by using the determined first network connection.
Preferably, the method is applied to a client.
In a further embodiment, the simultaneously initiating establishment of the TCP network connection between the client and the plurality of servers includes:
the client is connected with TCP networks of a plurality of servers and respectively executes a plurality of handshakes required by establishing connection by a transport layer protocol;
Determining a TCP network connection for which a connection is established at a shortest time as a first network connection, comprising:
the network connection that completes the multiple handshake at the shortest is determined to be the first network connection.
In a further embodiment, the method further comprises:
In response to a request by the client to access the data: setting a preemptive blocking pipeline and monitoring the preemptive blocking pipeline in real time;
Determining the network connection that completed the multiple handshake to be the shortest as the first network connection, comprising:
the TCP network connection establishing connection preemptively sends socket resources establishing connection to the preemptive blocking pipeline;
And when the preemptive blocking pipeline is monitored to be blocked, determining the first network connection according to the network connection information in the preemptive blocking pipeline, wherein the network connection information comprises the socket resource.
In a further embodiment, the method further comprises:
And closing other TCP network connections except the first network connection when the TCP network connection which is the shortest connection establishment time is determined to be the first network connection.
In a further embodiment, the method further comprises:
when the first network connection is abnormal or based on a given re-establishment connection requirement:
Network connection between the client and a plurality of servers is initiated again and simultaneously; determining the network connection which is the shortest established connection in time as the second network connection; and continuing to transmit the data message between the client and the server by using the determined second network connection.
In further embodiments, the determination of the reconnection initiated connection may be similar to the determination of the first connection.
In a further embodiment, the re-initiating the network connection of the client to the plurality of servers simultaneously:
The client is connected with the TCP network initiated by the plurality of servers, and performs a plurality of handshakes required by establishing connection by a transport layer protocol;
determining the TCP network connection for which the connection was established at the shortest time to be the second network connection, comprising:
and determining the network connection which is the shortest to complete the multiple handshakes as the second network connection.
In a further embodiment, the method further comprises:
When the first network connection is abnormal or based on a given re-establishment connection requirement: setting (establishing, resetting or configuring) a preemptive blocking pipe and monitoring the preemptive blocking pipe in real time;
Determining the network connection that completed the multiple handshake to be the shortest as the second network connection, comprising:
the TCP network connection establishing connection preemptively sends socket resources establishing connection to the preemptive blocking pipeline;
And when the preemptive blocking pipeline is monitored to be blocked, determining the second network connection according to the network connection information in the preemptive blocking pipeline, wherein the network connection information comprises the socket resource.
In a second aspect of the present disclosure, there is provided a data access method for service multiple activities, the method comprising:
Monitoring a data message of a client accessing a server;
intercepting the data message in response to the data message, and simultaneously initiating establishment of TCP network connection between the proxy service equipment and a plurality of service terminals;
determining the TCP network connection which is the shortest to establish connection in the TCP network connection between the proxy service equipment and a plurality of service terminals as a first network connection;
establishing a network IO bridge based on the determined first network connection;
And transmitting the data message between the client and the server through the proxy service equipment by utilizing the network IO bridging.
Preferably, the method is applied to a proxy service appliance. Preferably, the proxy service device is communicatively connected to a plurality of servers, for example, disposed between the plurality of servers and the client.
In a further embodiment, the simultaneously initiating the establishment of the network connection between the proxy service device and the plurality of service terminals includes:
The proxy service equipment is connected with TCP networks of a plurality of service ends and respectively executes a plurality of handshakes required by a transmission layer protocol for establishing connection;
Determining a TCP network connection for which a connection is established at a shortest time as a first network connection, comprising:
the network connection that completes the multiple handshake at the shortest is determined to be the first network connection.
In a further embodiment, the method further comprises:
In response to monitoring the data message: setting a preemptive blocking pipeline and monitoring the preemptive blocking pipeline in real time;
determining that the TCP network connection which establishes connection with the shortest time in the TCP network connection of the proxy service equipment and a plurality of service terminals is a first network connection:
the TCP network connection establishing connection preemptively sends socket resources establishing connection to the preemptive blocking pipeline;
And when the preemptive blocking pipeline is monitored to be blocked, determining the first network connection according to the network connection information in the preemptive blocking pipeline, wherein the network connection information comprises the socket resource.
In a further embodiment, the method further comprises: and closing other TCP network connections except the first network connection when the TCP network connection which is the shortest connection establishment time is determined to be the first network connection.
In a further embodiment, the method further comprises:
when the first network connection is abnormal or based on a given re-establishment connection requirement:
initiating TCP network connection between the proxy service equipment and a plurality of service terminals again at the same time, and determining the TCP network connection which establishes connection at the shortest time as a second network connection;
establishing a network IO bridge based on the determined second network connection
And continuing to execute the transmission of the data message between the client and the server through the proxy service equipment by using the network IO bridging established based on the second network connection.
In further embodiments, the determination of the reconnection initiated connection may be similar to the determination of the first connection.
In a further embodiment, the re-initiating the TCP network connection between the proxy service device and the plurality of servers simultaneously includes:
The proxy service equipment is connected with the TCP network reinitiated by a plurality of service terminals, and performs a plurality of handshakes required by establishing connection by a transport layer protocol respectively;
determining the TCP network connection for which the connection was established at the shortest time to be the second network connection, comprising:
and determining the network connection which is the shortest to complete the multiple handshakes as the second network connection.
In a further embodiment, the method further comprises:
When the first network connection is abnormal or based on a given re-establishment connection requirement: setting (establishing, resetting or configuring) a preemptive blocking pipe and monitoring the preemptive blocking pipe in real time;
Determining the network connection that completed the multiple handshake to be the shortest as the second network connection, comprising:
the TCP network connection establishing connection preemptively sends socket resources establishing connection to the preemptive blocking pipeline;
And when the preemptive blocking pipeline is monitored to be blocked, determining the second network connection according to the network connection information in the preemptive blocking pipeline, wherein the network connection information comprises the socket resource.
In a further embodiment, the data message of the access server of the listening client includes: monitoring a data message of a client access server at a given port (socket); the establishing a network IO bridge based on the determined first (second) network connection, comprising: a network IO bridge is established based on the given port and the first (second) network connection.
In a further embodiment, a zero-copy network IO bridge is established.
In a third aspect of the present disclosure, a client is provided, the client comprising a processor and a memory for storing one or more computer programs; wherein the computer program is configured to be executed by the one or more processors, the program comprising data access method steps for performing the service liveness as described in the first aspect of the present disclosure.
In a fourth aspect of the present disclosure, there is provided a proxy service device comprising a processor and a memory for storing one or more computer programs; wherein the computer program is configured to be executed by the one or more processors, the program comprising data access method steps for performing the service liveness as described in the second aspect of the present disclosure.
In a fifth aspect of the present disclosure, there is provided a network communication system including a client, a proxy service device, and a plurality of rooms; each machine room comprises one or more service ends, and at least one of the plurality of machine rooms is provided with the proxy service equipment; and network communication connection is established among the client, the proxy service equipment and the server. Preferably, the client is a client according to the third aspect. Preferably, the proxy service device is a proxy service device according to the fourth aspect.
It should be understood that what is described in this summary is not intended to limit the critical or essential features of the embodiments of the disclosure nor to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description.
Optional features and other effects of embodiments of the invention are described in part below, and in part will be apparent from reading the disclosure herein.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIGS. 1A and 1B are schematic diagrams of exemplary network architectures for service multi-lived disclosed in embodiments of the present invention;
FIG. 2 is a flow chart of a method for accessing data for service multiple activities applied to a client according to an embodiment of the present invention;
FIG. 3 schematically illustrates a schematic diagram of a network connection layering model;
FIG. 4 is a flow chart of a method for accessing data for service multiple activities applied to proxy service equipment according to an embodiment of the present invention;
fig. 5 schematically illustrates a diagram of a Socket resource sent to a preemptive blocking pipe after a connection is established by performing a handshake required by a transport layer protocol to establish the connection;
Fig. 6 is a schematic architecture diagram of an electronic device disclosed in an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In conventional approaches, the solutions generally adopted to avoid cross-machine room communication are conventional include: (1) The service in the machine room accesses the service program in the machine room through IP configuration, and the service program in the machine room cannot be effectively switched to the same-city machine room or a different-place machine room in a second level after abnormality occurs; (2) A multi-machine room multi-service cluster is established, and the realization of multi-machine room service is abandoned. For example, a machine room a deploys a Hadoop cluster a, a machine room B deploys a Hadoop cluster B, and the machine room a Hadoop cluster a and the machine room B Hadoop cluster B exist independently, so that multiple (double) activities with the same service cannot be achieved.
In the conventional scheme, for client access, the provided business multi-activity service has the following defects: (1) The APP connection multi-activity service machine room of the user strictly depends on DNS analysis, an optimal line and a shortest link machine room cannot be selected, after a fault occurs, the machine room cannot be switched in a second level by relying on manual retry or back-end retry of software such as Nginx and the like; (2) Because of the uncertainty of the network and the characteristic of dynamic routing, after the TCP is disconnected, the connection can be established only by initiating the repeated retry of the TCP, the TCP communication can not sense the network quality immediately, and the probability of data loss is increased; (3) Large data clusters across machine rooms often appear, and data or files of the same machine room often need to be written into a different place machine room across special lines of a network.
In the embodiment of the application, the machine room can be an HDFS cluster cross machine room, a Kafka cluster cross machine room and the like.
Fig. 1A and 1B illustrate schematic diagrams of example environments in which various embodiments of the present disclosure can be implemented. As shown in fig. 1A, the method can be applied to "forward communication" in the disclosure, that is, in an embodiment of the present application, a local user may initiate, through a client, data access directly connected to one of multiple servers.
In the embodiment of the application, the data is service data. Accordingly, the plurality of servers may be servers for multiple same services (Multi-Site High Availability). In the embodiment of the present application, the plurality of service ends may be service ends respectively located in multiple machine rooms. In some embodiments of the present application, the same business may have the same or similar meaning as multiple rooms, and may be referred to as business. In embodiments of the present application, "multiple lived" encompasses "dual lived" unless specifically indicated or concurrent. In some places herein, it will be appreciated that it is also possible to replace or supplement "multiple-activity" with high availability.
In the embodiment of the application, forward communication can be used for the client in the same machine room as the server or the internal user of the data or service provider.
With continued reference to fig. 1A, for example, a local user may directly initiate access to a plurality of different web servers in a plurality of machine rooms through a client, where 3 machine rooms (machine room 1, machine room 2, and machine room 3) are shown in the figure, one or more web servers are disposed in each machine room, and a web server corresponding to an optimal link is selected to execute a service through network connection established between the local client and the plurality of different web servers in the plurality of machine rooms.
As one possible implementation, as shown in fig. 1B, for "reverse communication" of the present disclosure, i.e., a user based on a proxy service device to enable access to multiple rooms or multiple different web servers within the same room, one or more web servers disposed within each room. The client forwards the corresponding access data or data message to the proxy service equipment, the proxy service equipment makes a decision of a plurality of links, and the client selects the web server corresponding to the optimal link to execute the service from the network connection established between the proxy service equipment and a plurality of different web servers in a plurality of machine rooms.
In the embodiment of the application, the reverse communication generally refers to the implementation of the reverse proxy through the proxy service equipment.
The following is a description of a data access method for service multiple activities provided in the first aspect of the embodiment of the present application. Preferably, the method is applicable to clients.
As shown in fig. 2, the method includes:
in response to a request by a client to access the data:
step S210, the establishment of TCP network connection between the client and a plurality of servers is initiated simultaneously.
In the embodiment of the application, the scheme is used for the client, so that the client can be directly connected with the server. For example, by executing a component such as a browser, software, or application of a client that initiates access to a web service, for example, to access related data, the object that initiates access is, for example, multiple servers (with the same business or business data) located in different rooms.
The network connection initiated in the embodiments of the present application is a transport layer network connection, more particularly a TCP network connection. The relevant network connection layers are schematically shown in fig. 3, where the OSI reference model divides the network into seven layers, physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer, respectively, from bottom to top, while the TCP/IP architecture divides the network into four layers, network interface layer, network layer, transport layer, application layer, respectively, from bottom to top.
The main function of the transmission layer is to provide reliable connection service for the sending end and the receiving end, and the transmission layer processes the data and provides the network layer. The function of the network layer is to manage the network, one of the cores is to select (route) paths, and there are many paths from the sending end to the receiving end, so the network layer is responsible for managing the router to which the data should be sent next. The data link layer, responsible for routing data from one router to another. The physical layer, the most basic network device, such as a network cable.
Among other things, the transmission control protocol (TCP, transmission Control Protocol) is a connection-oriented, reliable, byte-stream based transport layer communication protocol. TCP is used to provide connection-oriented services in which a connection must be established before data is transferred and released after the data transfer is completed.
A socket is an abstraction layer through which an application program can send or receive data, and can perform operations such as opening, reading, writing, and closing like a file. Sockets allow applications to insert I/O into the network and communicate with other applications in the network. A network socket is a combination of an IP address and a port, one socket being the end of a process communication on the network, providing a mechanism for application layer processes to exchange data using a network protocol. In terms of the position, the socket is connected with the application process in an upper mode, and the socket is connected with the network protocol stack in a lower mode, so that the socket is an interface for the application program to communicate through the network protocol, and is an interface for the application program to interact with the network protocol stack. In embodiments of the present invention, socket or socket may be used depending on the context.
In some embodiments, the establishment of a transport layer network connection, in particular a TCP network connection, may be achieved by operations specified according to a transport protocol, such as handshaking. As schematically shown in fig. 4, a TCP network connection is established through a three-way handshake.
The three-way handshake process is described taking the example of a client establishing a TCP network connection with a server. When the connection is established, the client sends a synchronous sequence number (SYN, synchronize Sequence Numbers) packet to the server, and when the server receives the SYN packet, the server sends an acknowledgement character (ACk, acknowledge character) packet to the client, and simultaneously sends a SYN packet of the client, and after receiving the syn+ack packet of the server, the client sends an ACk packet to the server, so that the three-way handshake connection is established.
By way of explanation and not limitation, the network connection-based decision mechanism (and the corresponding established connection) in the various aspects of the embodiments of the present invention are for a transport layer connection, and more particularly for a TCP connection. In the various technical solutions of the embodiments of the present invention, the solution of obtaining optimal connection transmission data in a service multi-active system is achieved in an extremely simple, efficient and elegant manner by means of a decision mechanism based on a transport layer connection (TCP connection), in particular based on a transport layer protocol, as described further below.
Step S220, determining the TCP network connection for which the connection is established at the shortest time as the first network connection.
Preferably, initiating establishment of the TCP network connection between the client and the plurality of servers simultaneously includes: the client is connected with TCP networks of a plurality of servers and respectively executes a plurality of handshakes required by a transport layer protocol; determining a TCP network connection for which a connection is established at a shortest time as a first network connection, comprising: the network connection that completes the multiple handshake at the shortest is determined to be the first network connection.
In embodiments of the present invention, the first network connection and the second network connection described below may also be referred to as an "optimal" network connection.
Preferably, in response to a request of the client to access data, a preemptive blocking pipe is set, and the preemptive blocking pipe is monitored in real time. The preemptive blocking pipe is based on preemptive blocking storage space, such as a segment of cache opened up at the client, as described below. In embodiments of the present invention, settings may be construed broadly, including but not limited to establishing (new), reusing, and/or resetting preemptive blocking pipes. For example, the preemptive blocking pipe may be newly set up each time a data request is accessed. Or the pre-emptive blocking pipe previously set up in the client may be reused and optionally reset. The above falls within the scope of the present invention.
Determining the network connection that completes the multiple handshakes to be the shortest as the first network connection, comprising: the transmission layer network connection establishing connection preemptively transmits established Socket resources to the preemptive blocking pipeline;
When the preemptive blocking pipeline is monitored to be blocked, determining the first network connection according to the network connection information in the preemptive blocking pipeline.
Step S230, executing the transmission of the data packet between the client and the server by using the determined first network connection.
In an embodiment of the present application, a pipe refers to a buffer of a given size, for example, which may be opened up in the memory of a client, for example, by an application program, when the client requests access to data. In an embodiment of the application, the conduit is a blocked conduit.
In one embodiment, the blocking pipe may consider a separate storage space opened up by the device or APP application, with default blocking: if there is no data in the pipe, read "blocking, if the pipe is full, write" blocking; the optimal TCP link information delivered to the blocking pipeline comprises Socket resources.
In an embodiment of the application, the pipe is a preemptive blocking pipe. By way of explanation and not limitation, multiple TCP network connections that are simultaneously initiated to establish are sent to the preemptive blocking pipe as "preemptive" after completing the network connection, e.g., after completing the required three-way handshake, so that the TCP network connection that first established the connection will "preempt" the pipe. Thus, by listening for the "preemption" of the pipe, an optimal network connection will be determined with minimal overhead. By way of explanation and not limitation, based on the characteristics of the blocked pipe, it is possible to simply monitor whether a write "writes" to be blocked, i.e., to determine that there is already a "shortest-in-time" TCP network connection establishment, which reduces overhead even more.
The blocking TCP pipe of this embodiment gracefully bypasses the traditional timer for receiving and storing the optimal TCP link object. And the optimal TCP link object is directly used for transmitting data, the additional overhead is the time spent in and out of the blocked TCP pipe. This time is done in nanoseconds, enabling nearly optimal decisions for multiple TCP to be made with about no delay.
Furthermore, the network connection information, such as Socket resources, used to "preempt" the pipe may also be used in data transmission between the client and the server; and the method can also be selectively used for closing other network connections, so that the simplicity and elegance of the implementation means of the embodiment of the invention are further increased.
For example, several coroutines are established according to a number of different target IPs, and then wait to block "in-flow" (acquire) optimal TCP links in the TCP pipe. Therefore, by preemptively blocking the pipeline, the TCP link with the optimal line and the first completed handshake flows into the established blocked TCP pipeline preferentially, and the optimal TCP link (determined by Socket resources) can be "fetched" from the blocked TCP pipeline for receiving and transmitting data messages.
In some embodiments, the TCP network connection that established the connection with the shortest time is determined to be the first network connection, and other network connections other than the first network connection are closed.
Other network connections herein may include all links where a client connects with multiple servers in multiple rooms (same or different) except for the current best link.
In some embodiments, when the first network connection is abnormal or based on a given connection reestablishment requirement, network connections of the client and the plurality of servers are initiated again simultaneously, the network connection with the shortest connection establishment is determined to be the second network connection, and a data message is sent to a link where the second network connection is located, so that communication is continuously performed.
In the embodiment of the application, network anomalies may include, but are not limited to, packet loss, network anomalies, network jitter, network interruption, and increased delay, for example.
If the phenomena of packet loss, network abnormality, network jitter, network interruption, delay increase and the like are encountered, the link decision is restarted. At this time, the blocked TCP pipe may be newly set or reset (cleared) or reconfigured, and the handshake order may be re-determined to determine the optimal TCP link, and the subsequent data packet may be further sent using the latest TCP link.
In embodiments of the present application, it is also conceivable to reinitiate the link decisions as described above based on a given re-establishment connection requirement. For example, for a network slice flow, establishing a new TCP network connection (e.g., initiating a handshake) is re-initiated for each slice, each time a TCP handshake is initiated a link decision as described above may be performed, i.e., a multi-path TCP hybrid contention is initiated.
In some embodiments, if the current first network connection is abnormal or a connection request is re-established, the first network connection cannot continue to perform network communication before. The re-competing selection of the best network connection may be re-conducted. Similarly, by initiating a re-competition selection of the optimal network connection, selecting the network connection with successful first handshake and determining the network connection as the second network connection, the data message transmission executed on the first network connection with optimal before can be switched to the second network connection with optimal before, so that the client can continue to execute Web service access, and the low-delay transmission of the data under multiple business activities can be realized by executing the mixed competition of links. The switching of the network connection (and thus the service side) for data transmission may perform corresponding operations such as data verification, which may be implemented in a known or novel manner, which is not described herein.
For example, for a network slice flow, each initiation of a TCP handshake requires initiation of multiple TCP hybrid contentions to cope with the uncertainty of the network and the nature of dynamic routing. Dynamic adaptation is enabled by the present disclosure, i.e., this minute is the optimal for the a-line, but the a-line becomes very bad and the B-line becomes very good again due to the dynamic routing characteristics, at which time the solution according to the present example can reinitiate the link decision, select the best link, and continue sending the subsequent data messages with the latest TCP link.
In the embodiment of the application, a plurality of TCP connections of a plurality of machine rooms are simultaneously established through a user side during forward communication, the TCP connection established in the shortest time is selected according to the TCP handshake time, other TCP connections with higher time delay or network failure are discarded, data is received and transmitted, and the connection is closed after the data message is completed. And when the network is abnormal or the next TCP connection is initiated, the handshake success sequence information of each network connection except the first network connection is redetermined to select the optimal link, and the optimal link is decided in a second level, so that the technical problems that in the traditional technology, the user side cannot select the optimal line and the shortest machine room of the link, the service machine room cannot be switched in a second level after the user side fails, the service end has more activity across the machine room service, the data transmission is frequent, the cost of a special network line is high, the special network line is often blocked, the big data operation cannot access the local machine room service nearby, and the network bandwidth waste of a cluster mode is large when the big data is deployed across the machine room are solved. By establishing a plurality of TCP connections from the TCP hierarchy through the APP, the optimal network and the optimal link are intelligently selected according to a plurality of machine rooms, and the smoothness of accessing the website or the APP by the user terminal is improved.
In embodiments of the present application, the features of The (TCP) link decision at the time of the access request may be incorporated into embodiments of re-executing (TCP) link decisions, or vice versa.
The second aspect of the embodiment of the application also provides a data access method for multiple services, which is applied to proxy service equipment, wherein the proxy service mechanism is in communication connection with a plurality of service ends and is used for accessing application scenes of the plurality of service ends in a plurality of machine rooms, namely reverse communication, by the client through the proxy service equipment. In the embodiment of the application, the reverse communication is set for other non-local users to execute the transmission and access of big data information.
For example, 3 machine rooms are respectively provided with 3 web servers, and a remote client in the traditional technology cannot know how to quickly access the web server with the highest speed, and the traditional scheme can be DNS random resolution, ng ix random load balancing and the like, which is time-consuming and wastes network resources.
The proxy service device of the present embodiment may be implemented, for example, in an edge server, which is a set of servers in a two-to-three-tier architecture, where the first tier is a front-end server that is directly connected to the user, and is therefore called an edge server.
The reverse proxy server is located between the user and the target server, but the reverse proxy server is equivalent to the target server for the user, i.e., the user directly accesses the reverse proxy server to obtain the resources of the target server. Meanwhile, the user does not need to know the address of the target server or make any setting at the user side. The reverse proxy server can be used as Web acceleration, namely, the reverse proxy is used as a front-end processor of the Web server to reduce the load of a network and the server and improve the access efficiency.
As shown in fig. 5, the method for accessing data of service multiple activities applied to a proxy service device includes:
Step S510, monitoring a data message of a client access server;
In some embodiments, the data message may be listened to by listening to a port or Socket (Socket). Specifically, the local listening Socket can be started in the proxy service device: 9300.
Step S520, responding to the monitored data message, intercepting the data message, and simultaneously initiating establishment of TCP network connection between the proxy service equipment and a plurality of service ends;
Preferably, in response to the monitored data message, intercepting the data message, and simultaneously initiating establishment of network connection between the proxy service device and a plurality of service terminals, including:
The proxy service equipment is connected with TCP networks of a plurality of service ends and respectively executes multiple handshakes required by a transport layer protocol;
Determining a TCP network connection for which a connection is established at a shortest time as a first network connection, comprising: the network connection that completes the multiple handshake at the shortest is determined to be the first network connection.
Since the first step of reverse communication is to intercept the data message that the client accesses the service from the server, and then transmit the data message to the server. The reverse communication (reverse communication) process is as follows: client- > Socket Proxy- > Server.
In step S530, it is determined that, among the network connections between the proxy service device and the plurality of service terminals, the TCP network connection that uses the shortest connection establishment is the first network connection.
Specifically, in the embodiment of the application, after the network connection handshake is successful, the accessed server sends a corresponding feedback message to the proxy service device, and the proxy service device determines that the network connection corresponding to the first received feedback message is the first network connection based on the feedback message sent by the network connection receiving server. At this time, once the proxy service device receives the handshake success data for the first time, the current best link can be saved, and the handshake operation of other links is terminated. Likewise, a blocking pipeline can be opened up on the proxy service device to receive the optimal TCP link, and the optimal TCP link is fetched from the blocking TCP pipeline for sending and receiving the data message.
In embodiments of the present invention, embodiments or features of "reverse communication" (TCP) link decisions applied to, for example, a reverse proxy server may refer to embodiments or features of "forward communication" (TCP) link decisions applied to, for example, a client, or vice versa. Embodiments or features of "reverse communication" (TCP) link decisions, such as applied to reverse proxy servers, are not described in detail herein.
S540: a network IO bridge is established based on the determined first optimal network.
A network IO bridge is established based on the determined first optimal network. More specifically, according to the Socket opened (monitored) and the first network connection, establishing a first network IO bridge; and the client and the server execute network communication through a first network IO bridge. Wherein the bridging (Bridging) is a process of forwarding network packets according to the address of the link layer of the OSI network model, operating at the second layer of the OSI.
Step S550, the network IO bridge is utilized to perform the transmission of the data message between the client and the server through the proxy service device. And transmitting the data message according to the determined first network connection, and closing other network connections except the first network connection.
Specifically, in the embodiment of the present application, the data packet of the Socket established through reverse communication is forwarded to the new optimal TCP link (second network connection) to perform transmission. For example, the optimal TCP link selected after the decision: socket 127.0.0.1:12380- - -1.1.1.1:80; the local reverse communication ports are 8080:socket 127.0.1:8080- - -socket 127.0.0.1:12380- - -1.1.1.1:80.
In the embodiment of the application, the reverse communication access for the remote client is realized based on the proxy service equipment. (1) monitoring a data message by starting a Socket; (2) intercepting a data message of an access service; (3) simultaneously establishing a plurality of TCP connections of a plurality of machine rooms; (4) Selecting the TCP connection established in the shortest time according to the TCP handshake time, and discarding other TCP connections with higher time delay or network failure; (5) Establishing network IO bridging by connecting the Socket opened in the step (1) and the optimal TCP selected in the step (4); based on the network IO bridge in the step (5), the zero-copy technology is utilized to reduce the switching between a user mode and a kernel mode, thereby greatly reducing the CPU utilization rate and improving the Socket network communication read-write efficiency. If the network is abnormal, the optimal TCP link is re-decided to be selected, and a new network IO bridge is established in the second level. In the embodiment of the application, zero-copy (zero-copy) refers to the fact that when a computer performs an operation, a CPU does not need to copy data from a memory somewhere to another specific area, and this technology is generally used to save CPU cycles and memory bandwidth when files are transferred through a network. For example, if a file is to be read and sent over a network, the data is copied twice and the context is switched twice in a conventional manner for each read/write cycle, and the copying of the data is dependent on the CPU. The same operation is done by zero copy technique, context switching is reduced to two times, and the CPU is not required to copy the data.
Illustratively, when the first network connection is abnormal or based on a given connection reestablishment requirement, re-initiating the TCP network connection between the proxy service equipment and the plurality of service terminals at the same time, and determining the TCP network connection with the shortest connection establishment time as the second network connection; establishing a network IO bridge based on the determined second network connection; and continuing to execute the transmission of the data message between the client and the server through the proxy service equipment by using the network IO bridging established based on the second network connection.
In a further embodiment, a second network IO bridge is established according to the Socket and the second network connection, and the data packet is sent to the second network IO bridge.
In some embodiments, determining the optimal network connection again may exclude the first network connection. Preferably, if the first network connection is abnormal, determining first handshake success information of each network connection in each machine room except the first network connection, selecting the network connection with the first handshake success and determining the network connection as the second network connection.
Specifically, if the first network connection is abnormal, the handshake success sequence information of each network connection except the first network connection is redetermined, and the network connection with the first handshake success is selected and determined as the second network connection.
In the embodiments of the present invention, embodiments or features of re-executed (TCP) link decisions such as "reverse communication" applied to a reverse proxy server may refer to embodiments or features of first executed (TCP) link decisions of "reverse communication" and/or "forward communication" link decisions such as applied to a client, which are not described herein.
Therefore, the embodiment realizes that the service accessing the same machine room is preferentially selected, and a large amount of data transmission across the machine room caused by the calling of the network service across the machine room is avoided; and can be easily switched to the current optimal server through link decision when the server in the same machine room fails.
For example, the reverse proxy device establishes a TCP network connection (handshake) with all servers in multiple rooms, including the local room, so that when deciding, if there is an available server with the room, the optimal connection can always be obtained through link decision. In other words, when no fault exists, the connection with the machine room is often realized, so that the service preferentially accessing the same machine room is realized, and a large amount of data transmission across the machine room caused by the call of the network service across the machine room is avoided. In addition, the embodiment can also realize that the first network connection which is optimal before is connected to other available service ends in the same machine room when the first network connection which is optimal before is abnormal through the re-executed link connection.
Based on the method, for the scene of deployment of cluster mode and business multiple activities of service end big data across machine rooms, the large data clusters across machine rooms are mutually called and accessed, the service of the same machine room is preferentially accessed through decision TCP, transmission across machine rooms is avoided, the network environment is self-adaptive, and the network failure is switched in seconds, so that data reading and writing across machine rooms can be effectively avoided, bandwidth is saved, communication cost across machine rooms is reduced, and network quality across machine rooms is improved.
In the embodiment of the application, the service access is initiated in the same machine room, the service of the same machine room can be always accessed preferentially through the reverse communication proxy, the transmission of a large amount of data across the machine room caused by the calling of the network service of the machine room is avoided, the second-level switching to the different-place machine room can be realized when the network is abnormal, and the occupation of the network special line of the large data across the machine room cluster is greatly reduced. Big data spans machine room clusters, e.g., HDFS clusters across machine rooms, kafka clusters across machine rooms, etc.
The embodiment also discloses a client, which comprises a processor and a memory, wherein the memory is used for storing one or more computer programs; wherein the computer program is configured to be executed by the one or more processors, the program comprising data access method steps for performing service multi-activity as described in embodiments of the invention, the method being particularly applicable to clients.
In addition, the embodiment also discloses a proxy service device, which comprises a processor and a memory, wherein the memory is used for storing one or more computer programs; wherein the computer program is configured to be executed by the one or more processors, the program comprising data access method steps for performing service multi-lived according to an embodiment of the invention, the method being particularly applicable to reverse proxy devices.
In addition, the embodiment also discloses a network communication system, which comprises the client and a plurality of machine rooms; each machine room comprises one or more service ends. Optionally, the network communication system may further comprise a proxy service device as described above. And network communication connection is established among the client, the proxy service equipment and the server.
The system, apparatus, module or unit set forth in the above embodiments, e.g., client, proxy service device, server-side network communication system, may be implemented by one or more electronic devices in the form of a computer or associated components thereof.
Fig. 6 shows a schematic diagram of an electronic device 600 in which embodiments of the invention may be implemented or implemented, and in some embodiments may include more or fewer electronic devices than shown. In some embodiments, it may be implemented with a single or multiple electronic devices. In some embodiments, implementation may be with cloud or distributed electronic devices.
As shown in fig. 6, the electronic device 600 includes a processor 601 that can perform various appropriate operations and processes according to programs and/or data stored in a Read Only Memory (ROM) 602 or programs and/or data loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may be a multi-core processor or may include multiple processors. In some embodiments, processor 601 may comprise a general-purpose main processor and one or more special coprocessors such as, for example, a Central Processing Unit (CPU), a Graphics Processor (GPU), a neural Network Processor (NPU), a Digital Signal Processor (DSP), and so forth. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The above-described processor is used in combination with a memory to execute a program stored in the memory, which when executed by a computer is capable of implementing the methods, steps or functions described in the above-described embodiments.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, touch screen, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608. Only some of the components are schematically shown in fig. 6, which does not mean that the computer system 600 includes only the components shown in fig. 6.
Although not shown, in some embodiments a storage medium is also provided, storing a computer program. The computer program is configured to perform the method of any of the embodiments of the invention when run.
Storage media in embodiments of the invention include both permanent and non-permanent, removable and non-removable items that may be used to implement information storage by any method or technology. Examples of storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Thus, it will be apparent to those skilled in the art that the functional modules/units or controllers and associated method steps set forth in the above embodiments may be implemented in software, hardware, and a combination of software/hardware.
The acts of the methods, procedures, or steps described in accordance with the embodiments of the present invention do not have to be performed in a specific order and still achieve desirable results unless explicitly stated. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Various embodiments of the invention are described herein, but for brevity, description of each embodiment is not exhaustive and features or parts of the same or similar between each embodiment may be omitted. Herein, "one embodiment," "some embodiments," "example," "specific example," or "some examples" means that it is applicable to at least one embodiment or example, but not all embodiments, according to the present invention. The above terms are not necessarily meant to refer to the same embodiment or example. Those skilled in the art may combine and combine the features of the different embodiments or examples described in this specification and of the different embodiments or examples without contradiction.
The exemplary systems and methods of the present invention have been particularly shown and described with reference to the foregoing embodiments, which are merely examples of the best modes for carrying out the systems and methods. It will be appreciated by those skilled in the art that various changes may be made to the embodiments of the systems and methods described herein in practicing the systems and/or methods without departing from the spirit and scope of the invention as defined in the following claims.

Claims (13)

1. A data access method for multiple services, which is applied to a client, the method comprising:
in response to a request by a client to access the data:
Simultaneously initiating and establishing TCP network connection between the client and a plurality of servers;
determining the TCP network connection which is the shortest connection establishment time as a first network connection;
and executing the transmission of the data message between the client and the server by using the determined first network connection.
2. The method for accessing data for multiple services according to claim 1, wherein,
The step of simultaneously initiating establishment of TCP network connection between the client and a plurality of servers comprises the following steps:
the client is connected with TCP networks of a plurality of servers and respectively executes a plurality of handshakes required by establishing connection by a transport layer protocol;
Determining a TCP network connection for which a connection is established at a shortest time as a first network connection, comprising:
the network connection that completes the multiple handshake at the shortest is determined to be the first network connection.
3. The service-oriented data access method according to claim 1 or 2, characterized in that the method further comprises:
In response to a request by the client to access the data: setting a preemptive blocking pipeline and monitoring the preemptive blocking pipeline in real time;
Determining the network connection that completed the multiple handshake to be the shortest as the first network connection, comprising:
the TCP network connection establishing connection preemptively sends socket resources establishing connection to the preemptive blocking pipeline;
And when the preemptive blocking pipeline is monitored to be blocked, determining the first network connection according to the network connection information in the preemptive blocking pipeline, wherein the network connection information comprises the socket resource.
4. The service-oriented data access method according to claim 1 or 2, characterized in that the method further comprises:
And closing other TCP network connections except the first network connection when the TCP network connection which is the shortest connection establishment time is determined to be the first network connection.
5. The service-oriented data access method according to claim 1 or 2, characterized in that the method further comprises:
when the first network connection is abnormal or based on a given re-establishment connection requirement:
Network connection between the client and a plurality of servers is initiated again and simultaneously; determining the network connection which is the shortest established connection in time as the second network connection; and continuing to transmit the data message between the client and the server by using the determined second network connection.
6. A data access method for multiple services, applied to a proxy service device, where the proxy service device is communicatively connected to a plurality of service terminals, the method comprising:
Monitoring a data message of a client accessing a server;
intercepting the data message in response to the data message, and simultaneously initiating establishment of TCP network connection between the proxy service equipment and a plurality of service terminals;
determining the TCP network connection which is the shortest to establish connection in the TCP network connection between the proxy service equipment and a plurality of service terminals as a first network connection;
establishing a network IO bridge based on the determined first network connection;
And transmitting the data message between the client and the server through the proxy service equipment by utilizing the network IO bridging.
7. The method for accessing data for multiple services according to claim 6, wherein said simultaneously initiating establishment of network connections between said proxy service device and multiple servers comprises:
The proxy service equipment is connected with TCP networks of a plurality of service ends and respectively executes a plurality of handshakes required by a transmission layer protocol for establishing connection;
Determining a TCP network connection for which a connection is established at a shortest time as a first network connection, comprising:
the network connection that completes the multiple handshake at the shortest is determined to be the first network connection.
8. The service-oriented data access method according to claim 6 or 7, characterized in that the method further comprises:
In response to monitoring the data message: setting a preemptive blocking pipeline and monitoring the preemptive blocking pipeline in real time;
determining that the TCP network connection which establishes connection with the shortest time in the TCP network connection of the proxy service equipment and a plurality of service terminals is a first network connection:
the TCP network connection establishing connection preemptively sends socket resources establishing connection to the preemptive blocking pipeline;
And when the preemptive blocking pipeline is monitored to be blocked, determining the first network connection according to the network connection information in the preemptive blocking pipeline, wherein the network connection information comprises the socket resource.
9. The service-oriented data access method according to claim 6 or 7, characterized in that the method further comprises: and closing other TCP network connections except the first network connection when the TCP network connection which is the shortest connection establishment time is determined to be the first network connection.
10. The service-oriented data access method according to claim 6 or 7, characterized in that the method further comprises:
when the first network connection is abnormal or based on a given re-establishment connection requirement:
initiating TCP network connection between the proxy service equipment and a plurality of service terminals again at the same time, and determining the TCP network connection which establishes connection at the shortest time as a second network connection;
establishing a network IO bridge based on the determined second network connection;
And continuing to execute the transmission of the data message between the client and the server through the proxy service equipment by using the network IO bridging established based on the second network connection.
11. A client comprising a processor and a memory for storing one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, the program comprising data access method steps for performing the service multi-activity of any of claims 1-5.
12. A proxy service device comprising a processor and a memory for storing one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, the program comprising data access method steps for performing the service multi-activity of any of claims 6-10.
13. A network communication system, the network communication system comprising a client, a proxy service device, and a plurality of rooms; each machine room comprises one or more service ends, and at least one of the plurality of machine rooms is provided with the proxy service equipment; network communication connection is established among the client, the proxy service equipment and the server;
Wherein the client is a client according to claim 11; and/or the proxy service device is a proxy service device according to claim 12.
CN202211650186.6A 2022-12-21 2022-12-21 Service multi-activity data access method, client, proxy service equipment and network communication system Pending CN118233517A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211650186.6A CN118233517A (en) 2022-12-21 2022-12-21 Service multi-activity data access method, client, proxy service equipment and network communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211650186.6A CN118233517A (en) 2022-12-21 2022-12-21 Service multi-activity data access method, client, proxy service equipment and network communication system

Publications (1)

Publication Number Publication Date
CN118233517A true CN118233517A (en) 2024-06-21

Family

ID=91504657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211650186.6A Pending CN118233517A (en) 2022-12-21 2022-12-21 Service multi-activity data access method, client, proxy service equipment and network communication system

Country Status (1)

Country Link
CN (1) CN118233517A (en)

Similar Documents

Publication Publication Date Title
US10491523B2 (en) Load distribution in data networks
US10257266B2 (en) Location of actor resources
RU2380746C2 (en) Network load balancing using host status information
AU2004202403B2 (en) Network load balancing with connection manipulation
USRE45806E1 (en) System and method for the optimization of database access in data base networks
US11115481B2 (en) Transmission control of protocol state exchange for dynamic stateful service insertion
US7613822B2 (en) Network load balancing with session information
US7567504B2 (en) Network load balancing with traffic routing
US7590736B2 (en) Flexible network load balancing
US11218358B2 (en) Network connection and termination system
CN111565229A (en) Communication system distributed method based on Redis
US8352619B2 (en) Method and system for data processing
WO2022148363A1 (en) Data transmission method and data transmission server
WO2022105730A1 (en) Method and apparatus for ensuring same source and same destination of sctp multi-homing packet
WO2017219813A1 (en) Traffic processing method and transparent buffer system
CN104660550A (en) Method for performing session migration among plurality of servers
RU2387002C2 (en) Levelling network load through connection control
US20220337615A1 (en) Dynamic sessional redirection and proxy
CN118233517A (en) Service multi-activity data access method, client, proxy service equipment and network communication system
CN110290196A (en) A kind of content distribution method and device
CN114584518B (en) Websocket load balancing method and system based on resource pool
WO2023281295A1 (en) Stateful endpoint mobility in a federated cloud computing system
CN117896445A (en) Multi-network protocol switching transmission method and device, electronic equipment and storage medium
CN118101442A (en) Network state recovery method, processing system and computing device cluster

Legal Events

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