Network connection method and network connection system

By synchronizing the status information of network connections in a distributed system and dynamically migrating between multiple nodes, the service damage caused by disaster recovery disconnection of existing connections is solved, and high availability and service continuity of network connections are achieved.

CN115766833BActive Publication Date: 2025-08-05ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211262010.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2025-08-05
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

In distributed systems, the problem of service damage caused by disaster recovery disconnection, especially in storage gateways or content distribution networks. When the storage gateway fails, the disconnection of the stock connection leads to service interruption and data loss.

Method used

By synchronizing the status information to multiple nodes when the status information of the network connection is updated, and selecting one of these nodes to connect to the network connection, a distributed consistency protocol such as Raft or Multi-Raft protocol is adopted to ensure that the status information remains consistent among multiple nodes, realizing dynamic migration and high availability of network connections.

Benefits of technology

It realizes that there is no need to re-establish a network connection in the event of failure, maintains service continuity, avoids service interruption and data loss, and improves the high availability of network connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766833B_ABST
    Figure CN115766833B_ABST
Patent Text Reader

Abstract

This application relates to a network connection method and system. The method includes: synchronizing the network connection status information to multiple nodes corresponding to the network connection when the network connection status information is updated; and reconnecting the network connection at one of the multiple nodes based on the status information. This application solves the problem of service loss caused by existing connections being disconnected due to disaster recovery, thereby achieving high network connection availability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a network connection method and a network connection system. Background Art

[0002] In traditional distributed systems, disaster recovery for each component is typically achieved through a retry mechanism. For example, a storage system is generally divided into a storage gateway and data nodes. Users access data by connecting to the storage gateway, which in turn retrieves the data from the data nodes. Data nodes are typically composed of multiple machines, and user data is replicated across multiple machines. If a single machine fails and the storage gateway fails to access it, it will attempt to access other machines, thereby achieving internal disaster recovery. However, the storage gateway itself must remain available at all times. Therefore, updates to this service are typically infrequent, and even when they do occur, they are implemented through hot updates to prevent the storage gateway from disconnecting users.

[0003] In a content delivery network (CDN), storage gateways typically implement disaster recovery through DNS scheduling. However, DNS scheduling is delayed. When a storage gateway fails, the existing connections (i.e., established connections) in the storage gateway will be disconnected, causing service damage. Summary of the Invention

[0004] This embodiment provides a network connection method and a network connection system to solve the problem in related technologies that existing connections are disconnected due to disaster recovery and result in service damage.

[0005] A network connection method, comprising:

[0006] When the state information of the network connection is updated, synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection;

[0007] The network connection is continued at a node among the plurality of nodes based on the status information.

[0008] In some embodiments, the network connection is identified by a five-tuple, and the state information includes: data and a sequence number of the network connection, and the data includes request data and / or response data.

[0009] In some embodiments, continuing the network connection at one of the plurality of nodes based on the state information includes:

[0010] One of the plurality of nodes constructs a response packet for responding to the client's request based on the state information, and sends the response packet to the client; and

[0011] A node among the plurality of nodes updates the state information.

[0012] In some embodiments, synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection includes:

[0013] A mechanism of a distributed consistency protocol is used to synchronize the state information of the network connection to a plurality of nodes corresponding to the network connection, wherein the plurality of nodes constitute a consensus group of the distributed consistency protocol.

[0014] In some embodiments, before synchronizing the state information of the network connection to the multiple nodes, the method further includes:

[0015] Determining, based on the quintuple of the network connection, whether the network connection is an existing connection, wherein the existing connection refers to a network connection that has been established and has not been disconnected;

[0016] When the network connection is not an existing connection, a plurality of nodes are designated for the network connection as a consensus group for synchronizing state information of the network connection.

[0017] In some embodiments, the plurality of nodes include a leader and one or more followers; wherein, when state information of a network connection is updated, synchronizing the state information of the network connection to the plurality of nodes corresponding to the network connection includes:

[0018] When the leader receives a request packet from a client, the leader processes the request packet and generates a response packet;

[0019] The leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet, and updates the status information of the network connection;

[0020] The leader writes the state information of the network connection into a synchronization log corresponding to the network connection, so as to synchronize the state information of the network connection to the one or more followers;

[0021] After the state information of the network connection is synchronized, the leader sends the response packet to the client.

[0022] In some embodiments, when state information of a network connection is updated, synchronizing the state information of the network connection to multiple nodes corresponding to the network connection includes:

[0023] In the case that any follower receives a request packet from the client, any follower forwards the request packet to the leader.

[0024] In some embodiments, the plurality of nodes include a leader and one or more followers; wherein, when state information of a network connection is updated, synchronizing the state information of the network connection to the plurality of nodes corresponding to the network connection includes:

[0025] When any one of the multiple nodes receives a request packet from a client, the any one node processes the request packet and generates a response packet, wherein the request packet is distributed to the multiple nodes according to a load balancing strategy;

[0026] Any node determines the network connection corresponding to the request packet according to the quintuple information of the request packet, and updates the status information of the network connection;

[0027] In the case where any one of the nodes is a leader, the any one of the nodes writes the state information of the network connection into a synchronization log corresponding to the network connection, so as to synchronize the state information of the network connection to the one or more followers; after the synchronization of the state information of the network connection is completed, the any one of the nodes sends the response packet to the client;

[0028] In the case where any one of the nodes is a follower, the any one of the nodes sends the network connection status information to the leader; after the leader synchronizes the network connection status information to the one or more followers, the any one of the nodes sends the response packet to the client.

[0029] In some embodiments, the state information is stored in a memory corresponding to the node after being synchronized to the node.

[0030] A network connection system includes a plurality of nodes corresponding to the network connection, wherein the plurality of nodes include a leader and one or more followers, wherein:

[0031] The leader is configured to synchronize the state information of the network connection to the one or more followers when the state information of the network connection is updated;

[0032] Any node among the plurality of nodes connects to the network based on the state information.

[0033] In some embodiments, the system further comprises:

[0034] The load balancing device is used to distribute the client's request packet to the multiple nodes according to the load balancing strategy.

[0035] Compared with related technologies, the network connection method and network connection system provided in this embodiment synchronize the status information of the network connection to multiple nodes corresponding to the network connection when the status information of the network connection is updated; and continue the network connection at one of the multiple nodes based on the status information, thereby solving the problem of service damage caused by disaster recovery disconnection of existing connections and achieving high availability of network connections.

[0036] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:

[0038] Figure 1 FIG. 4 is a schematic diagram of a content distribution network according to this embodiment.

[0039] Figure 2 is a flowchart of the network connection method of this embodiment.

[0040] Figure 3 This is an optional process of the network connection method of this embodiment. Figure 1 .

[0041] Figure 4 This is an optional process of the network connection method of this embodiment. Figure 2 .

[0042] Figure 5 It is a schematic diagram of a network connection system of this embodiment.

[0043] Figure 6 FIG. 2 is a schematic diagram of another network connection system of this embodiment. DETAILED DESCRIPTION

[0044] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0045] This embodiment provides a network connection method, which can be applied to distributed systems or other systems with system boundary devices, including but not limited to distributed storage systems, distributed content distribution systems, etc. Taking the content distribution network as an example, Figure 1 is a schematic diagram of the content distribution network of this embodiment, such as Figure 1As shown, the content distribution network includes an origin server cluster 10 and a node device 20 located at the system boundary. The node device 20 at the system boundary can be, for example, a gateway device. A client 30 (i.e., a user) obtains data in the origin server cluster 10 by establishing a network connection with the gateway device.

[0046] Figure 2 is a flow chart of the network connection method of this embodiment, such as Figure 2 As shown, based on the above-mentioned content distribution network, the network connection method provided in this embodiment includes the following steps:

[0047] Step S201: When the state information of the network connection is updated, the state information of the network connection is synchronized to a plurality of nodes corresponding to the network connection.

[0048] Each network connection established between a client and a node device 20 is identified by a five-tuple, namely, the source IP address, source port address, destination IP address, destination port address, and network transmission protocol. In addition, when each data packet is generated and transmitted on the network connection, the state information of the network connection is updated, wherein the state information includes but is not limited to the data and the sequence number of the network connection, wherein the data includes request data and / or response data. The data refers in particular to data transmitted through the network connection, currently cached, and not yet sent to the client 30 or the source server cluster 10.

[0049] Taking the TCP / IP protocol as an example, in addition to data, a TCP protocol header also contains an important field for indicating the status information of the network connection, namely the sequence number of the network connection. Each end of the TCP session contains a 32-bit sequence number, which is used to track the amount of data sent by that end. When the TCP protocol assembles received data packets, it determines the order of the packets based on the sequence number and can determine whether any data packets are lost. Each packet in a TCP session contains a sequence number, and the receiving end uses an acknowledgment number to notify the sending end that the data has been successfully received. In other words, if the status information of the network connection can be synchronized between multiple nodes, any of the multiple nodes can use the status information to continue the network connection, and the client cannot perceive changes in the node at the other end of the network connection.

[0050] Each of the above nodes can refer to a physical machine or a virtual machine, or a process in a physical machine or a virtual machine.

[0051] Step S202: Reconnecting a network connection at one of the multiple nodes based on the status information.

[0052] When a client uses a content distribution network, it needs to maintain a network connection with the system edge device (storage gateway). In related technologies, if the network connection between the client and the system edge device is disconnected due to any reason such as disaster recovery or upgrade, the network connection status information will be lost, and the client will need to re-establish a new network connection with an available system edge device. This process will not only cause a longer service interruption due to the network connection establishment, but also, because the network connection is disconnected and the network connection status information is lost, the cached data of the previous network connection will be lost or the ongoing service will be interrupted, resulting in losses.

[0053] By adopting the network connection method of steps S201 to S202 above, there is no need to spend a long time to re-establish a new network connection. The established network connection will be migrated to the new node in real time to continue providing services to the client, and the transmitted data will also be retained, thereby avoiding losses caused by network connection interruption.

[0054] Based on the status information of the network connection, that is, the cached data of the network connection and the serial number of the network connection, the node that has been synchronized with the status information of the network connection can generate a correct response packet in combination with the status information after obtaining the client's request packet, and send the response packet to the client. From the client's point of view, the response packet is the response packet that correctly responds to the request packet through the network connection. The client will not feel the changes in the opposite node. The network connection is neither disconnected nor needs to be reconnected during this process, that is, the dynamic migration of existing network connections between multiple nodes is realized, and the dynamic continuation of network connections is realized.

[0055] At the same time, each time a response packet is generated, the network connection status information may be updated. Each time the network connection status information is updated, the network connection status information is synchronized and the network connection is reconnected through the above-mentioned steps S201 and S202. The above-mentioned response packet includes but is not limited to a response data packet carrying response data or an ACK message carrying an acknowledgment number.

[0056] Each network connection is assigned to a subset of all nodes, and a corresponding relationship is established between these nodes. This relationship is identified using the network connection's identification information. For example, a consensus group is identified using the five-tuple information of the network connection. This consensus group includes multiple nodes and represents a group of nodes that need to synchronize the state information of a network connection. This consensus group can be established using a distributed consensus protocol. The correspondence between nodes and network connections is generated during the establishment of the network connection.

[0057] In some embodiments, the synchronization of the network connection status information or the designation of the consensus group can be achieved through a distributed consensus protocol or a mechanism based on the protocol. The distributed consensus protocol can be the Raft protocol, and the mechanism based on the Raft protocol can be Multi-Raft.

[0058] The Raft protocol is a protocol based on the concept of a replicated state machine. In this embodiment, the Raft protocol treats each network connection as a state machine. The network connection receives external commands to change state. These changes are deterministic: as long as the initial state and the received commands are deterministic, the state at any moment is also deterministic. In the Raft protocol, a consensus group is generated for the network connection. All nodes within this consensus group have unequal status. Raft divides all nodes into three mutually exclusive subsets: leader, follower, and candidate. Candidate status is a temporary state. Only when a leader re-election is necessary will a follower temporarily transition to candidate status and participate in the leader election. After a new leader is elected, all other nodes transition to follower status. Therefore, the operation of the Raft-based network connection method primarily involves transactions between the leader and followers. The leader maintains control over the followers, including issuing control commands to each follower and performing operations such as creating and writing synchronization logs. Followers, in turn, follow the leader's instructions, synchronizing information in the synchronization log issued by the leader and performing corresponding actions according to the leader's instructions. The leader also continuously sends heartbeat packets to all followers in the consensus group to assert its authority and maintain its dominance. If a follower does not receive a heartbeat packet from the leader within a given period of time, it assumes that the leader has failed and becomes a candidate to run for leader.

[0059] In the Raft protocol, instructions are transmitted in the form of logs, which means that the state information in the above embodiment is synchronized to other followers through logs. Although there may be many nodes in the consensus group, only one node, acting as the leader, can confirm the data that needs to be synchronized and write this data to the synchronization log. Therefore, all synchronization logs receive client requests, and all other nodes receive the replication log from the leader, parsing and executing the replication log to change the state. All nodes execute the same log (instructions) in sequence to maintain state consistency.

[0060] Among them, the Raft protocol can synchronize the status information of all network connections. However, since the Raft protocol performs serial operations when using logs to synchronize status information, that is, the synchronization of the status information of the next network connection can only be performed after the synchronization of the status information of the previous network connection is completed. When there are a large number of network connections, the synchronization operation may be delayed too much, affecting the transmission efficiency of the network connection and even causing data loss.

[0061] To this end, in this embodiment, the Multi-Raft protocol can be used to improve the efficiency of state information synchronization. In this embodiment, the Multi-Raft protocol treats the state information of each network connection as a data slice and generates a consensus group and synchronization log for each data slice.

[0062] In some embodiments, before synchronizing the state information of the network connection to multiple nodes, it is necessary to ensure that a corresponding relationship has been established between the network connection and the multiple nodes. If a corresponding relationship has not been established, the corresponding relationship can be established according to the following steps: after receiving the request packet, the five-tuple information of the network connection is obtained according to the information carried in the protocol header of the request packet, and the five-tuple information is searched in all the consensus groups that have been established. If there is no consensus group identified by the five-tuple in all the consensus groups, the network connection is judged to be an existing connection; if there is a consensus group identified by the five-tuple in all the consensus groups, the network connection is judged to be an existing connection (a connection that has been established and has not been disconnected). In the case that the network connection is an existing connection, the above steps S201 to S202 can be executed; otherwise, after designating multiple nodes as the consensus group for synchronizing the state information of the network connection for the new network connection, electing the leader and follower in the consensus group and establishing the synchronization log, the above steps S201 to S202 are executed again.

[0063] Each consensus group elects a node as a leader through a protocol, and the other nodes in the consensus group act as followers. In some embodiments, the leader processes the client request packets received by the network connection corresponding to the consensus group. The process of the network connection method provided in this embodiment is as follows: Figure 3 As shown, the process includes the following steps:

[0064] In step S301, the client sends a request packet to a gateway device at the system boundary, requesting to establish a network connection; the request packet arrives at any gateway device randomly.

[0065] Step S302: The gateway device that receives the request packet queries, based on the five-tuple information carried in the request packet, whether there is a consensus group identified by the five-tuple information among the consensus groups that the gateway device has joined.

[0066] In step S303, if the gateway device fails to find a consensus group identified by the five-tuple information, several gateway devices including the gateway device are selected as the consensus group and identified by the five-tuple information; a leader is elected within the consensus group through a distributed consensus protocol, and other gateway devices are followers.

[0067] Step S304: If the gateway device that receives the request packet is a follower, the follower forwards the request packet to the leader.

[0068] Step S305: If the gateway device receiving the request packet is a leader, the leader processes the request packet and generates a response packet; the leader determines the network connection corresponding to the request packet based on the five-tuple information of the request packet and updates the status information of the network connection.

[0069] Step S306: The leader writes the status information of the network connection into the synchronization log corresponding to the network connection.

[0070] Step S307: The leader synchronizes the synchronization log to all followers.

[0071] Step S308: After the synchronization of the synchronization log is completed, the leader sends a response packet to the client.

[0072] After establishing a network connection, all client request packets received through the network connection are processed through the process of steps S302 to S308 above. Therefore, the leader processes all request packets, and the status information is directly updated by the leader and synchronized to other followers, reducing the overhead of log synchronization. If the above leader fails, the other followers in the consensus group will elect a new leader based on the distributed consensus protocol, thereby ensuring high availability of the network connection.

[0073] In other embodiments, both the leader and the follower can process the client request packet received by the network connection corresponding to the consensus group. The process of the network connection method provided by this embodiment is as follows: Figure 4 As shown, the process includes the following steps:

[0074] Step S401: The client sends a request packet to a gateway device at the system boundary, requesting to establish a network connection; the request packet arrives at any gateway device randomly.

[0075] Step S402: The gateway device that receives the request packet queries, based on the five-tuple information carried in the request packet, whether there is a consensus group identified by the five-tuple information among the consensus groups that the gateway device has joined.

[0076] In step S403, if the gateway device fails to find a consensus group identified by the five-tuple information, several gateway devices including the gateway device are selected as the consensus group and identified by the five-tuple information; a leader is elected within the consensus group through a distributed consensus protocol, and other gateway devices are followers.

[0077] Step S404: If the gateway device receiving the request packet is a follower, the follower processes the request packet and generates a response packet; the follower determines the network connection corresponding to the request packet based on the quintuple information of the request packet and updates the status information of the network connection.

[0078] Step S405: The follower sends the network connection status information to the leader.

[0079] Step S406: If the gateway device receiving the request packet is a leader, the leader processes the request packet and generates a response packet; the leader determines the network connection corresponding to the request packet based on the five-tuple information of the request packet and updates the status information of the network connection.

[0080] Step S407: The leader writes the status information of the network connection into the synchronization log corresponding to the network connection.

[0081] Step S408: The leader synchronizes the synchronization log to all followers.

[0082] Step S409: After the synchronization of the synchronization log is completed, the leader or follower sends the response packet it generates to the client.

[0083] After establishing a network connection, all client request packets received through the network connection are processed through the process of steps S402 to S409 above. All request packets are processed jointly by the leader or followers, achieving load balancing. Request packets can arrive randomly at any gateway device within the consensus group, or they can be distributed to gateway devices within the consensus group using a load balancer according to a load balancing strategy. If the leader fails, the other followers in the consensus group will elect a new leader based on the distributed consensus protocol, thereby ensuring high availability of the network connection.

[0084] In the above embodiment, the status information can be stored in the memory in the form of a synchronization log. Each node can not only quickly obtain the status information through the memory, but also the status information does not need to be stored in an additional database, thereby reducing the cost and complexity of system modification.

[0085] The network connection in the above embodiment may be a network connection established based on the TCP / IP protocol. When a network connection is established based on the TCP / IP protocol, the status information of the network connection includes but is not limited to data and the current sequence number (Sequence Number) of the network connection, wherein the above data includes response data sent by the node to the client, and may also include request data sent by the client to the node.

[0086] However, it is understood that when a network connection is established using other network protocols, the network connection status information may be other information that can be used to continue the network connection. For example, the network connection may also be a network connection established based on the Quick UDP Internet Connection (QUIC) protocol.

[0087] The QUIC protocol is a new communication protocol based on the UDP transport protocol and hopes to eventually replace all TCP-based HTTP requests. Due to the unreliability of UDP, with frequent packet loss, reordering, duplication, etc., UDP does not include the reliability and order guarantees of TCP that are strictly required by any higher-level protocol (such as HTTP). To this end, the QUIC protocol defines a layer on top of UDP that introduces error handling, reliability, flow control, and built-in security (through TLS 1.3) to UDP. In fact, it re-implements most of the functionality of TCP on top of UDP, but with one key difference: unlike TCP, it can still transmit data packets out of order. When using the QUIC protocol, similar to the TCP / IP protocol, the state information of the network connection includes but is not limited to data and sequence numbers.

[0088] This embodiment also provides a network connection system. Figure 5 is a schematic diagram of a network connection system of this embodiment, such as Figure 5 As shown, the system includes multiple nodes corresponding to network connections. These multiple nodes are divided into a leader 51 and one or more followers 52 by a distributed consensus protocol. The leader 51 and followers 52 are located at the system boundary. The consensus group corresponding to the network connection composed of the leader 51 and followers 52 jointly provides internal system services to the client 53, such as content distribution services and data storage services provided by the source server cluster 54 within the system.

[0089] A leader 51 is configured to synchronize the network connection status information to one or more followers 52 when the network connection status information is updated;

[0090] Any node among the plurality of nodes, ie, a follower 52 or a leader 51, is used to connect to the network based on the state information.

[0091] In some of the embodiments, the network connection is identified by a five-tuple, and the state information includes: data and a sequence number of the network connection, and the data includes request data and / or response data.

[0092] In some embodiments, the follower 52 or the leader 51 is configured to construct a response packet for responding to a request from a client and send the response packet to the client; and one of the multiple nodes updates state information.

[0093] In some of the embodiments, the leader 51 is configured to synchronize the state information of the network connection to a plurality of nodes corresponding to the network connection using a mechanism of a distributed consistency protocol, wherein the plurality of nodes constitute a consensus group of the distributed consistency protocol.

[0094] In some embodiments, the distributed consensus protocol includes the Raft protocol; and the mechanism based on the Raft protocol may be Multi-Raft.

[0095] In some of the embodiments, any one of the multiple nodes is further used to determine whether the network connection is an existing connection based on the quintuple of the network connection; and when the network connection is not an existing connection, designate multiple nodes for the network connection as a consensus group for synchronizing the status information of the network connection.

[0096] In some embodiments, the leader 51 is also used to: when the leader receives a request packet from the client, the leader processes the request packet and generates a response packet; the leader determines the network connection corresponding to the request packet based on the five-tuple information of the request packet, and updates the status information of the network connection; the leader writes the status information of the network connection into the synchronization log corresponding to the network connection to synchronize the status information of the network connection to one or more followers; after the synchronization of the status information of the network connection is completed, the leader sends the response packet to the client.

[0097] In some embodiments, the follower 52 is further configured to forward the request packet to the leader 51 upon receiving a request packet from the client.

[0098] In some of the embodiments, the system may further include a load balancing device 55 for obtaining a request packet from a client 53 and distributing the request packet to a leader 51 or a follower 52 according to a load balancing strategy.

[0099] The leader 51 or follower 52 is further configured to, upon receiving a request packet from a client, process the request packet and generate a response packet, wherein the request packet is distributed to multiple nodes according to a load balancing strategy; determine the network connection corresponding to the request packet based on the five-tuple information in the request packet, and update the status information of the network connection;

[0100] The leader 51 is further configured to write the network connection status information into the synchronization log corresponding to the network connection to synchronize the network connection status information to one or more followers 52; after the network connection status information synchronization is completed, a response packet is sent to the client.

[0101] The follower 52 is further configured to send the network connection status information to the leader 51 ; after the leader 51 synchronizes the network connection status information to one or more followers, it sends a response packet to the client.

[0102] In some embodiments, after being synchronized to a node, the state information is stored in a memory corresponding to the node.

[0103] Through the above embodiments, the state replicator mechanism is adopted to achieve high availability of existing network connections at the system boundary. The above embodiments do not require any modification or adaptation of the client's existing workflow, that is, sticky connection load balancing can be achieved in a non-invasive manner to users, and high connection availability can also be achieved without intrusion to users when a device at the system boundary fails.

[0104] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0105] Obviously, the accompanying drawings are merely examples or embodiments of the present application. A person skilled in the art can also apply the present application to other similar situations based on these drawings without inventive effort. Furthermore, it is understandable that, although the work involved in this development process may be complex and lengthy, certain design, manufacturing, or production changes based on the technical content disclosed in this application are merely routine technical means for a person skilled in the art and should not be considered to constitute a deficiency in the disclosure of the present application.

[0106] The term "embodiment" as used in this application refers to specific features, structures, or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily mean that the embodiment is the same, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is understood, either explicitly or implicitly, by those skilled in the art that the embodiments described in this application can be combined with other embodiments when there is no conflict.

[0107] Unless otherwise defined, the technical terms or scientific terms involved in this application should have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "an", "a", "the", "these" and the like in this application do not indicate quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, and B exists alone. Generally, the character " / " indicates that the related objects are in an "or" relationship. The terms "first," "second," "third," etc. used in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0108] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A network connection method, characterized in that include: When state information of a network connection is updated, synchronizing the state information of the network connection to multiple nodes corresponding to the network connection, the state information including: data and a sequence number of the network connection, the data including request data and / or response data, the data referring to data transmitted through the network connection and currently cached but not sent to the client or the origin server cluster; continuing the network connection at one of the plurality of nodes based on the state information; Connecting the network connection at one of the plurality of nodes based on the status information includes: One of the plurality of nodes constructs a response packet for responding to the client's request based on the state information, and sends the response packet to the client; and A node among the plurality of nodes updates the state information.

2. The method according to claim 1, characterized in that The network connection is identified by a quintuple.

3. The method according to claim 1, characterized in that Synchronizing the state information of the network connection to a plurality of nodes corresponding to the network connection includes: A mechanism of a distributed consistency protocol is used to synchronize the state information of the network connection to a plurality of nodes corresponding to the network connection, wherein the plurality of nodes constitute a consensus group of the distributed consistency protocol.

4. The method according to claim 3, characterized in that Before synchronizing the state information of the network connection to the multiple nodes, the method further includes: Determining, based on the quintuple of the network connection, whether the network connection is an existing connection, wherein the existing connection refers to a network connection that has been established and has not been disconnected; When the network connection is not an existing connection, a plurality of nodes are designated for the network connection as a consensus group for synchronizing state information of the network connection.

5. The method according to claim 4, characterized in that The multiple nodes include a leader and one or more followers; wherein, when the state information of the network connection is updated, synchronizing the state information of the network connection to the multiple nodes corresponding to the network connection includes: When the leader receives a request packet from a client, the leader processes the request packet and generates a response packet; The leader determines the network connection corresponding to the request packet according to the quintuple information of the request packet, and updates the status information of the network connection; The leader writes the state information of the network connection into a synchronization log corresponding to the network connection, so as to synchronize the state information of the network connection to the one or more followers; After the state information of the network connection is synchronized, the leader sends the response packet to the client.

6. The method according to claim 5, characterized in that When the state information of the network connection is updated, synchronizing the state information of the network connection to multiple nodes corresponding to the network connection includes: In the case that any follower receives a request packet from the client, any follower forwards the request packet to the leader.

7. The method according to claim 4, characterized in that The multiple nodes include a leader and one or more followers; wherein, when the state information of the network connection is updated, synchronizing the state information of the network connection to the multiple nodes corresponding to the network connection includes: When any one of the multiple nodes receives a request packet from a client, the any one node processes the request packet and generates a response packet, wherein the request packet is distributed to the multiple nodes according to a load balancing strategy; Any node determines the network connection corresponding to the request packet according to the quintuple information of the request packet, and updates the status information of the network connection; In the case where any one of the nodes is a leader, the any one of the nodes writes the state information of the network connection into a synchronization log corresponding to the network connection, so as to synchronize the state information of the network connection to the one or more followers; after the synchronization of the state information of the network connection is completed, the any one of the nodes sends the response packet to the client; In the case where any one of the nodes is a follower, the any one of the nodes sends the network connection status information to the leader; after the leader synchronizes the network connection status information to the one or more followers, the any one of the nodes sends the response packet to the client.

8. The method according to any one of claims 1 to 7, characterized in that After being synchronized to the node, the status information is stored in the memory corresponding to the node.

9. A network connection system, characterized in that comprising a plurality of nodes corresponding to network connections, the plurality of nodes comprising a leader and one or more followers, wherein, The leader is configured to synchronize the state information of the network connection to the one or more followers when the state information of the network connection is updated, the state information comprising: data and a sequence number of the network connection, the data comprising request data and / or response data, the data referring to data transmitted through the network connection and currently cached but not sent to the client or the origin server cluster; Any one of the multiple nodes connects the network connection based on the status information, including: one of the multiple nodes constructs a response packet for responding to the client's request based on the status information, and sends the response packet to the client; and one of the multiple nodes updates the status information.

10. The system according to claim 9, characterized in that The system further comprises: The load balancing device is used to distribute the client's request packet to the multiple nodes according to the load balancing strategy.

Citation Information

Patent Citations

  • Data consistency method for distributed service discovery cluster in micro-service architecture

    CN110661841A

  • Access request response method and device and distributed system

    CN114625489A