Data forwarding method and device, electronic equipment and storage medium

By obtaining the target identification code and communication link associated with the destination IP address, selecting the target link to send the access request to the target gateway, solving the problem of increasing delay and line blockage introduced across AZ bypass, and achieving efficient and reliable forwarding of access requests.

CN119697266APending Publication Date: 2025-03-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311238464.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In a complex network environment with cross-regional mutual access requirements, the prior art cannot guarantee that the access request just falls on the gateway corresponding to the accessed AZ resource, resulting in the problem of increasing the delay introduced by cross-AZ bypass and the possible blockage of the bypass line.

Method used

By obtaining the target identification code associated with the destination IP address and the communication link associated with the identification code, the target link is selected to send the access request to the target gateway to ensure that the access request falls on the gateway of the target Availability Zone.

Benefits of technology

It effectively avoids the problem of increased delay caused by cross-AZ bypass and the possible blockage of bypass lines, ensuring high reliability of access to Availability Zone resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697266A_ABST
    Figure CN119697266A_ABST
Patent Text Reader

Abstract

The invention provides a data forwarding method and device, electronic equipment and a storage medium, so as to enable an access request to fall on a gateway corresponding to an accessed available area resource, and avoid the problems of time delay increase and possible blockage of a bypassing line caused by AZ bypassing during data forwarding. The method comprises the following steps: receiving an access request sent for a target resource, wherein the access request comprises a target IP address of the target resource; obtaining a target identification code associated with the destination IP address, and obtaining at least one communication link associated with the target identification code; wherein the target identification code is used for uniquely identifying a target available area where the target resource is located; and selecting a target link from the at least one communication link, and sending the access request to the second gateway through the target link, so that the second gateway sends the access request to the target available area based on the target IP address.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In a complex network environment with cross-region access requirements, resources are generally deployed based on the region-availability zone (AZ) dimension in consideration of disaster recovery and reliability, and resource intercommunication is also achieved through gateway cluster forwarding.

[0003] See also Figure 1 As shown, taking the first region as an example, usually, each AZ in the first region corresponds to a gateway, and the available zone resources of the AZ where the gateway is located can be accessed through the gateway. When the resources in the first region are deployed in multiple AZs, and the gateway cluster composed of the gateways corresponding to the multiple AZs is deployed across AZs, the gateway cluster generally uses the Anycast Virtual Internet Protocol (Anycast VIP) of the same cluster granularity to provide network access to the outside world, and the line quality between two gateway clusters across regions can be covered by real-time detection.

[0004] When accessing the availability zone resources provided by AZ, the access request first falls on a gateway in the gateway cluster, and then the access request is forwarded to the availability zone resources being accessed through the gateway. Under the above architecture, the Anycast VIP of each gateway in the gateway cluster is the same, so any gateway in the gateway cluster may receive the access request and forward the received access request to the availability zone resources being accessed.

[0005] That is to say, under the above architecture, there is no guarantee that the access request will land on the gateway corresponding to the accessed availability zone resources. The gateway that receives the access request needs to send the access request across AZs to the accessed availability zone resources, which results in a cross-AZ detour.

[0006] Because resources in different availability zones in the same region may not be deployed in the same geographical area, cross-AZ detours will increase latency.

[0007] In addition, when the gateway that receives the access request forwards the access request across AZs to the accessed availability zone resources, if a fault occurs in the line between the accessed availability zone resources and the gateway, the detour path will be blocked, thereby affecting the forwarding of the access request and causing failure to access the availability zone resources.

[0008] Therefore, on the basis that the above architecture can provide high reliability, there is an urgent need for an effective solution that can solve the problems of increased delay introduced by AZ detour and possible blockage of detour lines. Summary of the invention

[0009] The present application provides a data forwarding method, device, electronic device and storage medium, so that an access request can fall on the gateway corresponding to the accessed available zone resources, avoiding the problem of increased delay introduced by AZ detour and possible blockage of detour lines during data forwarding.

[0010] In a first aspect, an embodiment of the present application provides a data forwarding method, which is applied to a first gateway, and the method includes:

[0011] Receiving an access request sent for a destination resource, the access request including: a destination IP address of the destination resource; wherein the destination resource and the first gateway belong to availability zones in different regions respectively;

[0012] Obtaining a target identification code associated with the destination IP address, and obtaining at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction phase; wherein the target identification code is used to uniquely identify the target availability zone where the destination resource is located, and the communication link is a communication link between the first gateway and a second gateway corresponding to the target availability zone;

[0013] A target link is selected from the at least one communication link, and the access request is sent to the second gateway through the target link, so that the second gateway sends the access request to the target available zone based on the destination IP address.

[0014] In a second aspect, an embodiment of the present application provides a data forwarding device, the device comprising:

[0015] A receiving unit, configured to receive an access request sent for a target resource, wherein the access request includes: a target IP address of the target resource; wherein the target resource and the first gateway belong to availability zones in different regions respectively;

[0016] an acquisition unit, configured to acquire a target identification code associated with the destination IP address, and to acquire at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction phase; wherein the target identification code is used to uniquely identify a target availability zone where the destination resource is located, and the communication link is a communication link between the first gateway and a second gateway corresponding to the target availability zone;

[0017] A determination unit, configured to select a target link from the at least one communication link;

[0018] A sending unit is used to send the access request to the second gateway through the target link, so that the second gateway sends the access request to the target availability zone based on the destination IP address.

[0019] In a possible implementation, the acquisition unit, before acquiring the available zone identification code associated with the destination IP address, is further used to: acquire a preset first association relationship; wherein the preset first association relationship is an association relationship between each IP address and each identification code, each IP address corresponds to an identification code, and the identification code is used to uniquely identify the available zone;

[0020] When acquiring the target identification code associated with the destination IP address, the acquisition unit is specifically used to: obtain the target identification code corresponding to the destination IP address according to the first association relationship.

[0021] In a possible implementation, when acquiring the preset first association relationship, the acquisition unit is specifically used to: send a communication establishment request to each other gateway respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the other gateways that receive the communication establishment request; the other gateways are gateways other than the first gateway; receive a communication establishment response returned by each other gateway respectively; the communication establishment response carries an identification code of an available zone under the jurisdiction of the other gateway that sends the communication establishment response; obtain the IP address of each other gateway obtained in the network construction stage; and establish the first association relationship between the IP address of each other gateway and the identification code of the available zone under the jurisdiction of each other gateway.

[0022] In a possible implementation, the target availability zone identified by the target identification code is an availability zone under the jurisdiction of the second gateway; the determination unit, during the network establishment stage, records at least one communication link associated with the target identification code in the following manner: sending a communication establishment request to the second gateway through different communication links respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the second gateway, and the communication establishment request carries the link number of the corresponding communication link; receiving a communication establishment response returned by the second gateway through the different communication links respectively; the communication establishment response is used to indicate that the communication connection between the first gateway and the second gateway has been established, and the communication establishment response carries the target identification code of the target availability zone and the link number of the corresponding communication link; for each communication link, a second association relationship is established between the target identification code and the link number carried by the communication establishment response.

[0023] In one possible implementation, the access request also includes: a source IP address of the initiator of the access request; when the determination unit selects a target link from the at least one communication link, it is specifically used to: perform a hash operation based on the source IP address and the destination IP address to obtain a corresponding matching value; and obtain a link whose link number matches the matching value from the at least one communication link as the target link.

[0024] In a possible implementation, the acquisition unit, when obtaining the target identification code corresponding to the destination IP address based on the first association relationship, is specifically used to: when there is an IP address among the preset IP addresses that matches the network address of the destination IP address, use the identification code that has a first association relationship with the matching IP address as the target identification code.

[0025] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein the memory is used to store computer instructions; and the processor is used to execute computer instructions to implement the steps of the data forwarding method provided in the embodiment of the present application.

[0026] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the steps of the data forwarding method provided in the embodiment of the present application are implemented.

[0027] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; when the processor of an electronic device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the electronic device executes the steps of the data forwarding method provided in the embodiment of the present application.

[0028] The beneficial effects of this application are as follows:

[0029] The embodiment of the present application provides a data forwarding method, apparatus, device and storage medium; in the embodiment of the present application, first, the first gateway receives an access request including the destination IP address of the destination resource sent to the destination resource, and the destination resource and the first gateway belong to different regional availability zones respectively; then, the target identification code associated with the destination IP address is obtained, and at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction stage is obtained; then, a target link is selected from the at least one communication link, and the access request is sent to the second gateway through the target link, so that the second gateway sends the access request to the target availability zone based on the destination IP address. In the present application, through the association relationship between the identification code of the availability zone and the communication link and the association relationship between the identification code and the IP address that are pre-configured, the corresponding communication link can be selected for data forwarding according to the identification code of the availability zone where the destination IP address of the destination resource being accessed is located, so that the access request can fall exactly on the gateway corresponding to the target availability zone where the destination IP address is located, avoiding the delay problem caused by detouring across AZs, and the situation where access is unavailable due to abnormal lines between AZs.

[0030] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0032] Figure 1 A schematic diagram of the correspondence between an availability zone and a gateway provided in an embodiment of the present application;

[0033] Figure 2 A schematic diagram of gateway forwarding data in the prior art provided in an embodiment of the present application;

[0034] Figure 3 A schematic diagram of an access path in the prior art provided in an embodiment of the present application;

[0035] Figure 4 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0036] Figure 5 A flow chart of a data forwarding method provided in an embodiment of the present application;

[0037] Figure 6 A flow chart of a method for determining a first association relationship provided in an embodiment of the present application;

[0038] Figure 7 A schematic diagram of a routing entry provided in an embodiment of the present application;

[0039] Figure 8 A flow chart of a method for determining a second association relationship provided in an embodiment of the present application;

[0040] Fig. 9 A schematic diagram of the distribution of a communication link provided in an embodiment of the present application;

[0041] Fig.10 A flowchart for determining a second association relationship between a target identification code and a communication link provided in an embodiment of the present application;

[0042] Fig.11 A schematic diagram of establishing a communication connection provided in an embodiment of the present application;

[0043] Fig.12 A schematic diagram of another correspondence between available zones and gateways provided in an embodiment of the present application;

[0044] Fig.13 An example flow chart of data forwarding provided in an embodiment of the present application;

[0045] Fig.14 A schematic diagram of an access path provided in an embodiment of the present application;

[0046] Fig.15 A schematic diagram of a general process of data forwarding provided in an embodiment of the present application;

[0047] Fig.16 A structural diagram of a data forwarding device provided in an embodiment of the present application;

[0048] Fig.17 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and beneficial effects of this application clearer, the technical solution in the embodiment of this application will be clearly and completely described in conjunction with the drawings in the embodiment of this application. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments 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.

[0050] In order to help those skilled in the art better understand the technical solution of the present application, some concepts involved in the present application are introduced below.

[0051] Cloud Connect Network: CCN for short, is a service that provides users with intranet interconnection between different VPCs on the cloud and between VPCs and local data centers (IDCs). It has the capabilities of multi-point interconnection across the entire network, self-learning routes, link optimization, and fast fault convergence.

[0052] Communication link: A physical line from one node to an adjacent node in a network without any other switching nodes in between. In the present application, when establishing a communication link between a first gateway and a second gateway, it can also be expressed as establishing a tunnel between the first gateway and the second gateway.

[0053] Region: refers to the geographical region of the physical data center. Different regions are completely isolated from each other, which can achieve the greatest degree of fault tolerance and stability. Generally, after successfully creating a resource in a region, the resource cannot be moved to another region.

[0054] Availability Zone: Availability Zone, referred to as AZ. Availability Zone refers to a physical data center with independent power and network in the same region. Its goal is to ensure that faults between availability zones are isolated from each other (except for major disasters or major power failures), and that faults do not spread, so that users' businesses can continue to be online. In some scenarios, there can be multiple availability zones in a region, and different availability zones are physically isolated, but the intranets are interconnected. In this way, the independence of availability zones is guaranteed, and low-cost, low-latency network connections are provided.

[0055] Gateway: Also known as network connector or protocol converter. Gateway is the most complex network interconnection device that realizes network interconnection at the transport layer. It is only used for interconnection between two networks with different high-level protocols. Gateway can be used for both wide area network interconnection and local area network interconnection.

[0056] IP address (Internet Protocol Address): Internet Protocol address. IP address is a unified address format provided by the IP protocol. It assigns a logical address to each network and each host on the Internet to shield the differences in physical addresses.

[0057] In this application, each availability zone corresponds to a gateway, and the availability zone and the gateway can be deployed in the same geographical area. The gateways corresponding to multiple availability zones in the same region constitute a gateway cluster. The gateway clusters in the same region publish the same Anycast Internet Protocol Address (Anycast Internet Protocol Address, referred to as Anycast VIP address, or Anycast VIP), that is, the Anycast VIP of each gateway in the same gateway cluster is the same.

[0058] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0059] The terms "first" and "second" in this document are used for descriptive purposes only and should not be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, unless otherwise specified, the meaning of "multiple" is two or more.

[0060] The following is a brief introduction to the design concept of the embodiment of the present application:

[0061] In a complex network environment with cross-region access requirements, resources are generally deployed based on the region-availability zone dimension in consideration of disaster recovery and reliability, and resource intercommunication is also achieved through gateway cluster forwarding.

[0062] Normally, each AZ corresponds to a gateway, and the gateway can be used to access the resources in the availability zone of the AZ where the gateway is located. When resources in a region are deployed in multiple AZs, and the gateway cluster consisting of gateways corresponding to multiple AZs is deployed across AZs, the gateway cluster generally uses the same set of cluster-level Anycast Virtual Internet Protocol (Anycast VIP) to provide external network access. The line quality between two gateway clusters across regions can be covered by real-time detection. Figure 2 As shown, the second region includes three AZs, each AZ corresponds to a gateway, and gateways 21 to 23 form a gateway cluster, and the gateway cluster uses the same Anycast VIP to provide network access to the outside world. That is, in gateways 21 to 23, the Anycast VIP corresponding to each gateway is 30.0.0.0 / 24.

[0063] When accessing the available zone resources provided by AZ, the access request first falls on a gateway in the gateway cluster corresponding to the AZ, and then the access request is forwarded to the available zone resources being accessed through the gateway. In the above architecture, the Anycast VIP of each gateway in the gateway cluster is the same, so any gateway in the gateway cluster may receive the access request and forward the received access request to the available zone resources being accessed. Figure 2 For example, when accessing the available zone resources on AZ21 in the second region, since the Anycast VIPs corresponding to gateways 21-23 are all 30.0.0.0 / 24, any gateway among gateways 21-23 may receive the access request. That is, although the access request is to access the available zone resources on AZ21, gateway 22 may receive the access request and then forward the access request to the accessed available zone resources in AZ21.

[0064] As an example, Figure 3 As shown, the gateway corresponding to the availability zone where the S1 resource in the first region is located is gateway 11, and the gateway corresponding to the availability zone where the S2 resource in the second region is located is gateway 21. The first region may be the Beijing region, the second region may be the Shenzhen region, gateway 11 may be represented as CCNGW1, and gateway 21 may be represented as CCNGW3. When the S1 resource in the availability zone AZ11 of the first region wants to access the S5 resource in the availability zone AZ21 of the second region, since the gateway cluster of the second region also includes gateway 22, and the Anycast VIPs corresponding to gateways 21 and 22 are the same, the access path may be S1->gateway 11->gateway 22->S2.

[0065] That is to say, under the above architecture, there is no guarantee that the access request will land on the gateway corresponding to the accessed availability zone resources. The gateway that receives the access request needs to send the access request across AZs to the accessed availability zone resources, which results in a cross-AZ detour.

[0066] Because resources in different availability zones in the same region may not be deployed in the same geographic area, cross-AZ detours will increase latency.

[0067] In addition, when the gateway that receives the access request forwards the access request across AZs to the accessed availability zone resources, if a fault occurs in the line between the accessed availability zone resources and the gateway, the detour path will be blocked, thereby affecting the forwarding of the access request and causing failure to access the availability zone resources.

[0068] Therefore, on the basis that the above architecture can provide high reliability, there is an urgent need for an effective solution that can solve the problems of increased delay introduced by AZ detour and possible blockage of detour lines.

[0069] In view of this, an embodiment of the present application provides a data forwarding method, device, equipment and storage medium. In an embodiment of the present application, first, an access request sent for a destination resource is received, and the access request includes: a destination IP address of the destination resource; wherein the destination resource and the first gateway belong to different regional availability zones respectively; then, a target identification code associated with the destination IP address is obtained, and at least one communication link associated with the target identification code recorded by link detection during the network construction phase of the first gateway is obtained; wherein the target identification code is used to uniquely identify the target availability zone where the destination resource is located, and at least one communication link is a communication link between the first gateway and the second gateway corresponding to the target availability zone; finally, a target link is selected from at least one communication link, and the access request is sent to the second gateway through the target link, so that the second gateway sends the access request to the target availability zone based on the destination IP address.

[0070] In an embodiment of the present application, by pre-configured associations between identification codes of available zones and communication links, and associations between identification codes and IP addresses, the corresponding communication link can be selected for data forwarding based on the identification code of the available zone where the destination IP address of the target resource being accessed is located, so that the access request can fall exactly on the gateway corresponding to the target available zone where the destination IP address is located, thereby avoiding delay problems caused by cross-AZ detours and access failures due to line anomalies between AZs.

[0071] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0072] refer to Figure 4 , Figure 4 The schematic diagram of the application scenario of the embodiment of the present application includes a first region 100 and a second region 200, wherein the first region and the second region respectively include multiple availability zones, wherein each availability zone can be deployed on a server.

[0073] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0074] Figure 4The figure is only an example. In fact, the number of available areas is not limited and is not specifically limited in the embodiments of the present application.

[0075] In the embodiment of the present application, each availability zone corresponds to a gateway, and each gateway corresponds to an Anycast VIP. As an example, when availability zone AZ11 forwards a data packet to availability zone AZ21, if the host in availability zone AZ11 finds that the destination host of the data packet is not in the local network, the data packet is forwarded to gateway 11 corresponding to availability zone AZ11, and then gateway 11 forwards it to gateway 21 corresponding to availability zone AZ21, and gateway 21 corresponding to availability zone AZ21 forwards it to a host in availability zone AZ21.

[0076] Among them, gateway refers to a device with routing capabilities. Devices with routing functions include routers, servers with routing protocols enabled, proxy servers, etc.

[0077] It should be noted that the data forwarding method in the embodiment of the present application can be deployed in an electronic device, which can be a server, wherein the server can be a server with a routing protocol enabled, a proxy server, etc., and the electronic device can also be a router, which is not specifically limited in the present application.

[0078] Based on the above application scenarios, the data forwarding method provided by the exemplary embodiment of the present application is described below in combination with the application scenarios described above according to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this regard.

[0079] refer to Figure 5 , Figure 5 A flow chart of a data forwarding method in an embodiment of the present application is exemplarily provided, which is applied to a first gateway. The method includes:

[0080] S501, receiving an access request sent to a target resource, where the access request includes: a target IP address of the target resource; wherein the target resource and the first gateway belong to available zones in different regions respectively.

[0081] When initiating an access request, it can be determined whether the accessed destination resource is an available zone resource of the available zone where the access request is initiated according to the destination IP address of the destination resource in the access request. If it is not an available zone resource of the available zone where the access request is initiated, the first gateway receives the access request initiated for the destination resource. The destination IP address is the destination network interconnection protocol address.

[0082] In some embodiments, when each availability zone corresponds to a gateway, the first gateway may be the gateway corresponding to the availability zone where the access request is initiated. In other embodiments, when the region where the availability zone where the access request is initiated includes multiple availability zones that share a gateway, the first gateway is a shared gateway.

[0083] S502, obtaining a target identification code associated with the destination IP address, and obtaining at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction phase; wherein the target identification code is used to uniquely identify the target availability zone where the destination resource is located, and the communication link is a communication link between the first gateway and a second gateway corresponding to the target availability zone.

[0084] In some embodiments, the association between the destination IP address and the destination identification code is recorded through link detection when establishing a communication link.

[0085] Optionally, before obtaining the available zone identification code associated with the destination IP address, a preset first association relationship may also be obtained, where the preset first association relationship is the association relationship between each IP address and each identification code. Each IP address corresponds to an identification code, which is used to uniquely identify the available zone, and the preset first association relationship includes the association between the destination IP address and the target identification code. When obtaining the target identification code associated with the destination IP address, the target identification code corresponding to the destination IP address may be obtained specifically based on the first association relationship.

[0086] Specifically, when there is an IP address among the preset IP addresses that matches the network address of the destination IP address, an identification code that has a first association relationship with the matching IP address is used as the target identification code.

[0087] S503, selecting a target link from at least one communication link, and sending the access request to the second gateway through the target link, so that the second gateway sends the access request to the target availability zone based on the destination IP address.

[0088] In some embodiments, the access request also includes a source IP address of the initiator of the access request. Selecting a target link from at least one communication link can be implemented in the following manner: performing a hash operation based on the source IP address and the destination IP address to obtain a corresponding matching value. Furthermore, a link whose link number matches the matching value can be obtained from at least one communication link as the target link.

[0089] After the target link is determined, the access request may be sent to the second gateway corresponding to the target availability zone through the target link, so that the access request is sent to the target availability zone through the second gateway based on the destination IP address.

[0090] In an embodiment of the present application, by pre-configured associations between identification codes of available zones and communication links, and associations between identification codes and IP addresses, the corresponding communication link can be selected for data forwarding based on the identification code of the available zone where the destination IP address of the target resource being accessed is located, so that the access request can fall exactly on the gateway corresponding to the target available zone where the destination IP address is located, thereby avoiding delay problems caused by cross-AZ detours and access failures due to line anomalies between AZs.

[0091] In the embodiment of the present application, when obtaining the first association relationship between each preset IP address and each identification code, it can be specifically achieved through the following steps: Figure 6 The method flow for determining the first association relationship is exemplarily shown as follows:

[0092] Step S601: Send communication establishment requests to other gateways respectively.

[0093] In the embodiment of the present application, the communication establishment request is used to request to establish a communication connection. In the embodiment of the present application, taking the first gateway as an example, the first gateway can send communication establishment requests to other gateways respectively to request to establish a communication connection between the first gateway and the other gateways receiving the communication establishment request. Among them, each other gateway is a gateway other than the first gateway.

[0094] Step S602: receiving communication establishment responses returned by other gateways respectively.

[0095] In an embodiment of the present application, the communication establishment response carries the identification code of the available zone governed by the other gateway that sent the communication establishment request. Specifically, after the other gateway receives the communication establishment request, the other gateway can add the identification code of the available zone governed by the gateway to the communication establishment response and send the communication establishment response to the first gateway.

[0096] Exemplarily, the availability zone governed by the second gateway is AZ21, and the identification code corresponding to AZ21 is 10000. When the second gateway receives the communication establishment request sent by the first gateway, it can add the identification code 10000 to the communication establishment response and send the communication establishment response to the first gateway.

[0097] Step S603: Acquire the IP addresses of other gateways obtained during the network establishment phase.

[0098] Step S604: Establish a first association relationship between the IP address of each other gateway and the identification code of the available zone governed by each other gateway.

[0099] In an embodiment of the present application, the identification code carried in the communication establishment response returned by each other gateway can be supplemented in the routing entry corresponding to the IP address of each other gateway in the routing of the first gateway to establish a first association relationship between the IP address and the corresponding identification code.

[0100] Exemplarily, taking the second gateway as an example, the communication establishment response returned by the second gateway carries the identification code 10000 of the availability zone under the jurisdiction of the second gateway. In the routing table of the first gateway, the identification code 10000 returned by the second gateway is supplemented in the route to the second gateway, thereby indicating that the route can access the availability zone under the jurisdiction of the second gateway.

[0101] As an example, the IP address of the second gateway can be expressed as 30.0.0.0 / 24, and the available zone identification code carried in the communication establishment response returned by the second gateway is 10000. Then, the routing information from the first gateway to the second gateway can include the identification code 10000 of the available zone under the jurisdiction of the second gateway, such as Figure 7 shown.

[0102] In an embodiment of the present application, before acquiring at least one communication link associated with the target identification code, a second association relationship between the identification code and the communication link can be obtained, and then at least one communication link associated with the target identification code can be determined through the second association relationship.

[0103] In the embodiment of the present application, the second association relationship is recorded by the first gateway through the detection link during the network construction stage. The process of recording the second association relationship by the first gateway is described below. Figure 8 As shown, the specific steps are as follows:

[0104] Step S801, sending communication establishment requests to other gateways through different communication links respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and other gateways that receive the communication establishment request, and the communication establishment request carries the link number of the communication link.

[0105] In an embodiment of the present application, a detection pair configuration of the first region where the first gateway is located and other regional clusters is configured on the first gateway, and the detection pair includes multiple communication links. The communication links in the present application may also be referred to as tunnels. As an example, the detection pair includes 900 communication links. The first gateway periodically sends batch communication establishment requests (which may also be referred to as detection messages in the present application) to the gateway cluster in the opposite region through different communication links. For example, the first gateway is the gateway 11 corresponding to the availability zone AZ11 of the first region, and the other gateways are gateways corresponding to different availability zones included in the second region. The first gateway sends communication establishment requests to the gateways corresponding to different availability zones in the second region through different communication links. If there are 900 communication links, the 900 communication links will fall on gateways corresponding to different AZs in the second region, such as Fig. 9 shown.

[0106] In some embodiments, the communication establishment request includes a link number (tunnel id, abbreviated as tid), and the link number is used to uniquely identify the communication link between two gateways.

[0107] In addition, the communication establishment request may also include the IP address of the first gateway (dip), the detection pair number (tsid), and the detection batch number (mid).

[0108] In the embodiment of the present application, the communication establishment request sent by the first gateway through different communication links can fall on the gateways corresponding to different availability zones in the second region, thereby covering all physical routes.

[0109] Exemplarily, when sending the communication establishment request, the first gateway may send a request message.

[0110] Step S802, receiving communication establishment responses returned by each other gateway through different communication links; the communication establishment response is used to indicate that a communication connection has been established between the first gateway and the other gateways that sent the communication establishment response, and the communication establishment response carries an identification code of the available zone under the jurisdiction of the other gateways that sent the communication establishment response and a link number of the communication link.

[0111] In some embodiments, when a gateway receives a communication establishment request, it can add the identification code of the available zone under the jurisdiction of the gateway to the communication establishment response, and send the communication establishment response to the first gateway according to the corresponding communication link. The identification code of the available zone can be expressed as a zone id.

[0112] In some embodiments, after receiving the communication establishment request, the other gateways can determine the destination IP address of the return packet, that is, the IP address of the first gateway, according to the dip field in the communication establishment request. Then, after adding the identification code of the available zone where the gateway is located to the communication establishment request, a communication establishment response is obtained and sent to the first gateway through the corresponding communication link.

[0113] In some embodiments, the communication establishment response also includes a link number tid and a detection pair number tsid.

[0114] Step S803: Establish a second association relationship between each identification code and the link number carried in each communication establishment response.

[0115] In an embodiment of the present application, a second association relationship is established between the identification code and the link number through a communication establishment response. In some scenarios, the link numbers of the same identification code can be classified into one category, and then an association relationship between each identification code and the communication link is established. Through the identification code, the communication link to the available area identified by the identification code can be determined. For example, when determining to go to the available area with an identification code of 10000, the communication link to the available area can be determined.

[0116] For example, in the communication establishment response received by the first gateway, the identification codes included in the communication establishment responses with link numbers 1, 2, 4, and 6 are all 10000, and a second association relationship is established between the identification code 10000 and the link numbers 1, 2, 4, and 6. Further, when it is determined that the identification code of the target availability zone where the destination resource is located is 10000, it can be determined according to the second association relationship that a target link is selected from the communication links with link numbers 1, 2, 4, and 6 to forward the access request.

[0117] In the embodiment of the present application, the target availability zone identified by the target identification code is the availability zone governed by the second gateway. In the network construction stage, at least one communication link associated with the target identification code can be recorded through the following process, see Fig.10 As shown, the specific steps are as follows:

[0118] Step S1001, sending a communication establishment request to the second gateway through different communication links respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the second gateway, and the communication establishment request carries the link number of the communication link.

[0119] In the embodiment of the present application, the communication establishment request can be sent in the form of a request message.

[0120] like Fig.11As shown, the availability zone under the jurisdiction of the first gateway is availability zone AZ11 of the first region, and the first gateway is gateway 11. The availability zone under the jurisdiction of the second gateway is availability zone AZ21 of the second region, and the second gateway is gateway 21. Among them, the first gateway and the second gateway can be vbcgw gateways or CCNGW gateways, and this application does not make specific limitations on this. The first gateway can send a communication establishment request to the second gateway through different communication links. As an example, the first gateway (gateway 11) sends a communication establishment request to the second gateway (gateway 21) corresponding to availability zone AZ21 of the second region through a communication link with link number 1. Among them, the source IP address of the communication establishment request is the IP address of gateway 11, and the destination IP address of the communication establishment request is the IP address of gateway 22. The communication establishment request includes the detection pair number tsid, the link number tid, and the IP address (dip) of gateway 11.

[0121] Step S1002, receiving a communication establishment response returned by the second gateway through different communication links; the communication establishment response is used to indicate that a communication connection has been established between the first gateway and the second gateway, and the communication establishment response carries a target identification code of the target availability zone and a link number of the corresponding communication link.

[0122] As an example, after receiving the communication establishment request sent by the gateway 11 through the communication link with link number 1, the gateway 21 can add the identification code zoneid of the available zone under the jurisdiction of the gateway 21, the detection pair number tsid and the link number tid to the communication establishment response and send it to the gateway 11 through the communication link with link number 1. In some scenarios, the communication establishment response can be sent to the gateway 11 in the form of a reply message.

[0123] Step S1003: For each communication link, a second association relationship is established between the target identification code and the link number carried in the communication establishment response.

[0124] In some embodiments, when the link number included in the communication establishment response received by the gateway 11 is 1 and the target identification code is 10000, a second association relationship is established between the target identification code 10000 and the link number 1. When the gateway 11 receives multiple communication establishment responses sent by the gateway 21 through different tunnels, an association relationship is established between the target identification code and the link numbers in the different communication establishment responses. When it is determined that the target identification code of the target availability zone where the target resource is located is 10000, the link number that has a second association relationship with the target identification code can be determined, and then the access request is forwarded to the gateway 21 corresponding to the target availability zone through the communication link corresponding to the link number.

[0125] In some embodiments, a certain availability zone may correspond to two or more gateways, such as Fig.12As shown, the gateways corresponding to the availability zone AZ21 of the second region include gateway 21-1 and gateway 21-2, and the gateway corresponding to the availability zone AZ11 of the first region is gateway 11. When gateway 11 sends communication establishment requests to gateways 21-1 and 21-2 through different communication links to establish a communication connection, the availability zones governed by gateways 21-1 and 21-2 are both availability zones AZ21 of the second region. Then the identification codes of the availability zones in the communication establishment responses sent by gateways 21-1 and 21-2 to gateway 11 are both identification codes corresponding to availability zone AZ21 of the second region. Furthermore, a second association relationship is established between the identification code corresponding to availability zone AZ21 of the second region and different link numbers. That is, when the availability zone AZ21 in the first region requests access to the resources provided by the availability zone AZ21 in the second region, the link number can be determined through the second association relationship, and the communication link corresponding to the determined link number goes to gateway 21-1 or gateway 21-2 respectively, and then the access request can be forwarded to the availability zone AZ21 under its jurisdiction through gateway 21-1 or gateway 21-2.

[0126] Next, when the S1 resource in the available zone AZ11 of the first region accesses the S2 resource in the available zone AZ21 of the second region, the data forwarding method of the embodiment of the present application is explained. Fig.13 , Fig.13 An exemplary data forwarding method process in an embodiment of the present application is provided, including the following steps:

[0127] Step S1301: the gateway 11 receives an access request sent to a target resource.

[0128] Exemplarily, when the target object initiates an access request from the S1 resource to the S2 resource in the availability zone AZ21 of the second region, the destination resource is the S2 resource, and the gateway 11 receives the access request sent to the destination resource. Wherein, the gateway 11 is the gateway corresponding to the availability zone where the initiator is located when the target object initiates the access request, and the access request includes the IP address of the destination resource, that is, the IP address of the S2 resource.

[0129] Step S1302: the gateway 11 obtains a target identification code associated with a destination IP address in the access request.

[0130] Exemplarily, according to the first association relationship between each preset IP address and each identification code, the target identification code associated with the destination IP address is determined. As an example, the destination IP address is 10.22.2.0 / 24, and its network address is 10.22.2.0. When it is determined that the network address of the target IP address in each preset IP address is the same as the network address of the target IP address, the identification code that has a first association relationship with the target IP address is the target identification code. That is, the target identification code is the identification code of the availability zone where the S2 resource is located.

[0131] Step S1303: the gateway 11 obtains at least one communication link associated with the target identification code.

[0132] Exemplarily, at least one communication link associated with the target identification code is determined according to the second association relationship between each identification code and each communication link. Among the at least one communication link associated with the target identification code, the source IP address of each communication link is the IP address of the gateway 11, and the destination IP address is the IP address of the gateway 21 corresponding to the target availability zone AZ21.

[0133] Step S1304: select a target link from at least one communication link, and send the access request to the gateway 21 through the target link.

[0134] Exemplarily, the access request also includes the IP address of the initiator of the access request, that is, the IP address of the S1 resource. Furthermore, a target link can be selected from at least one communication link by the source IP address and the destination IP address. Specifically, the source IP address and the destination IP address can be hashed to obtain a corresponding matching value. Furthermore, a link whose link number matches the matching value can be obtained from at least one communication link as the target link. As an example, the IP address of the S1 resource and the IP address of the S2 resource can be hashed and the remainder can be obtained, and the link with the same link number as the remainder can be determined as the target link. For example, if the IP address of the S1 resource and the IP address of the S2 resource are hashed and the remainder is obtained by taking the remainder as 2, the communication link with the link number 2 is used as the target link.

[0135] Further, the destination IP address of the target link is the IP address of the gateway 21 , and after the target link is determined, the access request may be sent to the second gateway via the target link.

[0136] Step S1305: Gateway 21 sends the access request to the target availability zone based on the destination IP address.

[0137] In the present application embodiment, Fig.14 As shown, when the target object requests to access the S2 resource in the S1 resource, the access path is S1->gateway 11->gateway 21->S2, that is, the access request can fall on the gateway corresponding to the availability zone where the S2 resource is located, thereby avoiding the increase in latency caused by the cross-AZ detour and the problem of blocked detour paths.

[0138] The following takes the first gateway and the second gateway as an example to illustrate the process of establishing a communication connection and data forwarding between the first gateway and the second gateway. The first gateway is the gateway of the availability zone AZ11 in the first region, and the second gateway is the gateway of the availability zone AZ21 in the second region. Fig.15 As shown, the first gateway is gateway 11, and the second gateway is gateway 21. Assuming that 6 communication links are configured in gateway 11 for communication connection with gateway 21, gateway 11 sends communication establishment requests to gateway 21 through links with link numbers 1-6 respectively. After receiving the communication establishment request, gateway 21 sends a communication establishment response to gateway 11 through the corresponding link. When gateway 11 receives the communication establishment response, it means that a communication connection is established between gateway 11 and gateway 21. For example, if gateway 11 receives a communication establishment response returned by gateway 21 through communication links with link numbers 1, 2, 4, and 6, it means that gateway 21 can communicate with gateway 11 through communication links with link numbers 1, 2, 4, and 6.

[0139] For example, the communication establishment response includes an identification code and a link number, so that gateway 11 establishes a first association relationship between the IP address of gateway 21 and the identification code according to the communication establishment response, and a second association relationship between the availability zone AZ21 where gateway 21 is located and the link number.

[0140] Further, after receiving the access request, the gateway 11 determines, based on the first association relationship, that the identification code corresponding to the destination IP address in the access request is an identification code in the available zone 21 governed by the gateway 21. Further, based on the identification code, it is determined that the access request can be sent to the gateway 21 through the communication links with link numbers 1, 2, 4, and 6.

[0141] For example, the access request also includes the source IP address of the initiator of the access request, a hash calculation is performed based on the source IP address and the destination IP address to obtain a matching value, and a link matching the matching value is selected as the target link from the communication links with link numbers 1, 2, 4, and 6. For example, if the matching value obtained by hashing the source IP address and the destination IP address is 2, the communication link with link number 2 is selected as the target link. Further, gateway 11 sends the access request to gateway 21 through the communication link with link number 2, so that gateway 21 sends the access request to the target availability zone.

[0142] Please refer to Fig.16 , Fig.16 The embodiment of the present application provides a data forwarding device 1600, which includes:

[0143] The receiving unit 1601 is configured to receive an access request sent for a target resource, wherein the access request includes: a target IP address of the target resource; wherein the target resource and the first gateway belong to availability zones in different regions respectively;

[0144] The acquisition unit 1602 is used to acquire a target identification code associated with the destination IP address, and to acquire at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction stage; wherein the target identification code is used to uniquely identify the target availability zone where the destination resource is located, and the communication link is a communication link between the first gateway and a second gateway corresponding to the target availability zone;

[0145] The determining unit 1603 is configured to select a target link from at least one communication link;

[0146] The sending unit 1604 is configured to send the access request to the second gateway through the target link, so that the second gateway sends the access request to the target availability zone based on the destination IP address.

[0147] In a possible implementation, the acquisition unit 1602, before acquiring the available zone identification code associated with the destination IP address, is further used to: acquire a preset first association relationship; wherein the preset first association relationship is an association relationship between each IP address and each identification code, each IP address corresponds to an identification code, and the identification code is used to uniquely identify the available zone;

[0148] The acquisition unit, when acquiring the target identification code associated with the destination IP address, is specifically used to: obtain the target identification code corresponding to the destination IP address according to the first association relationship.

[0149] In a possible implementation, the acquisition unit 1602, when acquiring the preset first association relationship, is specifically used to: send a communication establishment request to each other gateway respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the other gateways that receive the communication establishment request; receive a communication establishment response returned by each other gateway respectively; the communication establishment response carries an identification code of the availability zone under the jurisdiction of the other gateway that sends the communication establishment request; obtain the IP address of each other gateway obtained in the network construction stage; and establish a first association relationship between the IP address of each other gateway and the identification code of the availability zone under the jurisdiction of each other gateway.

[0150] In a possible implementation, the target availability zone identified by the target identification code is an availability zone under the jurisdiction of the second gateway; the determination unit 1603, in the network construction stage, records at least one communication link associated with the target identification code in the following manner: sending a communication establishment request to the second gateway through different communication links respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the second gateway, and the communication establishment request carries the link number of the corresponding communication link; receiving a communication establishment response returned by the second gateway through different communication links respectively; the communication establishment response is used to indicate that the communication connection between the first gateway and the second gateway has been established, and the communication establishment response carries the target identification code of the target availability zone and the link number of the corresponding communication link; for each communication link, a second association relationship is established between the target identification code and the link number carried by the communication establishment response.

[0151] In one possible implementation, the access request also includes: the source IP address of the initiator of the access request; the determination unit 1603, when selecting a target link from at least one communication link, is specifically used to: perform a hash operation based on the source IP address and the destination IP address to obtain a corresponding matching value; and obtain a link whose link number matches the matching value from at least one communication link as the target link.

[0152] In one possible implementation, the acquisition unit 1602, when obtaining the target identification code corresponding to the destination IP address based on the first association relationship, is specifically used: when there is an IP address among the preset IP addresses that matches the network address of the destination IP address, the identification code that has the first association relationship with the matching IP address is used as the target identification code.

[0153] For the convenience of description, the above parts are divided into units (or modules) according to their functions and described separately. Of course, when implementing this application, the functions of each unit (or module) can be implemented in the same or multiple software or hardware.

[0154] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0155] After introducing the data forwarding method and device according to the exemplary embodiment of the present application, next, an electronic device for data forwarding according to another exemplary embodiment of the present application is introduced.

[0156] Based on the same inventive concept as the above method embodiment of the present application, an electronic device is also provided in the embodiment of the present application, and the electronic device may be a server. In this embodiment, the structure of the electronic device may be as follows: Fig.17 As shown, it includes a memory 1701 and one or more processors 1702.

[0157] The memory 1701 is used to store computer programs executed by the processor 1702. The memory 1701 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0158] The memory 1701 may be a volatile memory, such as a random-access memory (RAM); the memory 1701 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 1701 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1701 may be a combination of the above memories.

[0159] The processor 1702 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1702 is configured to implement the above data forwarding method when calling the computer program stored in the memory 1701 .

[0160] The specific connection medium between the memory 1701 and the processor 1702 is not limited in the embodiment of the present application. Fig.17 In the embodiment, the memory 1701 and the processor 1702 are connected via a bus 1703. The bus 1703 is connected to the processor 1702 via a bus 1703. Fig.17 The connections between the other components are only for illustration and are not intended to be limiting. The bus 1703 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.17 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or one type of bus.

[0161] The memory 1701 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the data forwarding method of the embodiment of the present application. The processor 1702 is used to execute the above-mentioned data forwarding method.

[0162] In some possible implementations, various aspects of the data forwarding method provided in the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the data forwarding method according to various exemplary implementations of the present application described above in this specification.

[0163] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0164] The program product of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on a computing device. However, the program product of the present application is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, device or device.

[0165] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0166] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0167] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0168] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0169] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0170] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0171] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0173] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data forwarding method, characterized in that: Applied to a first gateway, the method includes: Receiving an access request sent for a destination resource, the access request including: a destination IP address of the destination resource; wherein the destination resource and the first gateway belong to availability zones in different regions respectively; Obtaining a target identification code associated with the destination IP address, and obtaining at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction phase; wherein the target identification code is used to uniquely identify the target availability zone where the destination resource is located, and the communication link is a communication link between the first gateway and a second gateway corresponding to the target availability zone; A target link is selected from the at least one communication link, and the access request is sent to the second gateway through the target link, so that the second gateway sends the access request to the target available zone based on the destination IP address.

2. The method according to claim 1, characterized in that Before obtaining the available zone identification code associated with the destination IP address, the method further includes: Obtaining a preset first association relationship; wherein the preset first association relationship is a preset association relationship between each IP address and each identification code, each IP address corresponds to an identification code, and the identification code is used to uniquely identify an available zone; Then the step of obtaining the target identification code associated with the destination IP address includes: According to the first association relationship, a target identification code corresponding to the destination IP address is obtained.

3. The method according to claim 2, characterized in that The obtaining of the preset first association relationship includes: Sending communication establishment requests to other gateways respectively; the communication establishment requests are used to request to establish a communication connection between the first gateway and other gateways receiving the communication establishment requests; the other gateways are gateways other than the first gateway; Receiving communication establishment responses returned by the other gateways respectively; the communication establishment responses carry identification codes of available zones governed by the other gateways that sent the communication establishment responses; Obtaining the IP addresses of the other gateways obtained during the network construction phase; The first association relationship is established between the IP address of each other gateway and the identification code of the available zone governed by each other gateway.

4. The method according to claim 1, characterized in that The target availability zone identified by the target identification code is an availability zone governed by the second gateway; In the network establishment stage, at least one communication link associated with the target identification code is recorded in the following manner: sending a communication establishment request to the second gateway through different communication links respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the second gateway, and the communication establishment request carries a link number of the corresponding communication link; receiving communication establishment responses returned by the second gateway respectively through the different communication links; the communication establishment responses are used to indicate that a communication connection between the first gateway and the second gateway has been established, and the communication establishment responses carry a target identification code of a target available zone and a link number of a corresponding communication link; For each communication link, a second association relationship is established between the target identification code and the link number carried in the communication establishment response.

5. The method according to any one of claims 1 to 4, characterized in that: The access request also includes: a source IP address of the initiator of the access request; Then selecting a target link from the at least one communication link comprises: Perform a hash operation based on the source IP address and the destination IP address to obtain a corresponding matching value; From the at least one communication link, a link whose link number matches the matching value is obtained as the target link.

6. The method according to claim 2 or 3, characterized in that: The obtaining, according to the first association relationship, a target identification code corresponding to the destination IP address includes: When there is an IP address matching the network address of the destination IP address among the preset IP addresses, an identification code having a first association relationship with the matching IP address is used as the target identification code.

7. A data forwarding device, characterized in that: The device comprises: A receiving unit, configured to receive an access request sent for a target resource, wherein the access request includes: a target IP address of the target resource; wherein the target resource and the first gateway belong to availability zones in different regions respectively; an acquisition unit, configured to acquire a target identification code associated with the destination IP address, and to acquire at least one communication link associated with the target identification code recorded by the first gateway through link detection during the network construction phase; wherein the target identification code is used to uniquely identify a target availability zone where the destination resource is located, and the communication link is a communication link between the first gateway and a second gateway corresponding to the target availability zone; A determination unit, configured to select a target link from the at least one communication link; A sending unit is used to send the access request to the second gateway through the target link, so that the second gateway sends the access request to the target availability zone based on the destination IP address.

8. The device according to claim 7, characterized in that The obtaining unit, before obtaining the available zone identification code associated with the destination IP address, is further used to: Obtaining a preset first association relationship; wherein the preset first association relationship is an association relationship between each IP address and each identification code, each IP address corresponds to an identification code, and the identification code is used to uniquely identify an available zone; The acquisition unit, when acquiring the target identification code associated with the destination IP address, is specifically used to: According to the first association relationship, a target identification code corresponding to the destination IP address is obtained.

9. The device according to claim 8, characterized in that The obtaining unit, when obtaining the preset first association relationship, is specifically used to: Sending communication establishment requests to other gateways respectively; the communication establishment requests are used to request to establish a communication connection between the first gateway and other gateways receiving the communication establishment requests; the other gateways are gateways other than the first gateway; Receiving communication establishment responses returned by the other gateways respectively; the communication establishment responses carry identification codes of available zones governed by the other gateways that sent the communication establishment responses; Obtaining the IP addresses of the other gateways obtained during the network construction phase; The first association relationship is established between the IP address of each other gateway and the identification code of the available zone governed by each other gateway.

10. The device according to claim 7, characterized in that The target availability zone identified by the target identification code is an availability zone governed by the second gateway; The determining unit, in the network establishment stage, records at least one communication link associated with the target identification code in the following manner: sending a communication establishment request to the second gateway through different communication links respectively; the communication establishment request is used to request to establish a communication connection between the first gateway and the second gateway, and the communication establishment request carries a link number of the corresponding communication link; receiving communication establishment responses returned by the second gateway respectively through the different communication links; the communication establishment responses are used to indicate that a communication connection between the first gateway and the second gateway has been established, and the communication establishment responses carry a target identification code of a target available zone and a link number of a corresponding communication link; For each communication link, a second association relationship is established between the target identification code and the link number carried in the communication establishment response.

11. The device according to any one of claims 7 to 10, characterized in that: The access request also includes: a source IP address of the initiator of the access request; The determining unit, when selecting a target link from the at least one communication link, is specifically configured to: Perform a hash operation based on the source IP address and the destination IP address to obtain a corresponding matching value; From the at least one communication link, a link whose link number matches the matching value is obtained as the target link.

12. The device according to claim 8 or 9, characterized in that The acquisition unit, when acquiring the target identification code corresponding to the destination IP address according to the first association relationship, is specifically used to: When there is an IP address matching the network address of the destination IP address among the preset IP addresses, an identification code having a first association relationship with the matching IP address is used as the target identification code.

13. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer instructions; The processor is used to obtain computer instructions stored in the memory and execute the method according to any one of claims 1 to 6 according to the computer instructions.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.