Traffic distribution method, device, electronic device and storage medium
By determining the forwarding target of data packets based on service quality and load balancing strategies in the data center, the poor service quality caused by ISP dynamic routing protocol is solved, and higher service quality and system stability are achieved.
Patent Information
- Application Number
- CN202210524708.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-13
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-05-13
AI Technical Summary
In the prior art, when ISPs use dynamic routing protocols to determine the data centers that provide services from multiple data centers, there are problems with poor service quality, especially load imbalance and connection resetting.
The electronic device in the first data center receives the data packet sent by the ISP, and in the absence of connection, determines the service quality of the second data center with better service quality than the first data center and forwards data to it according to the service quality of the data center, and uses the service quality of the data center, and uses it to the data center. Packets, make decisions through connections to tracking records, load balancing policies, and real-time state of data centers.
Through rescheduling between data centers, service quality is improved, load imbalance and connection reset are avoided, and user access stability and system robustness are ensured.
Smart Images

Figure CN115022334B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a flow distribution method, device, electronic device and storage medium. Background Art
[0002] An Internet Service Provider (ISP) can use a dynamic routing protocol to determine a data center that provides services from multiple data centers. In the related art, there is a problem of poor service quality. Summary of the invention
[0003] In view of this, embodiments of the present application provide a traffic distribution method, device, electronic device, and storage medium to at least improve the service quality.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application embodiment provides a traffic distribution method, which is applied to a first electronic device in a first data center, and the method includes:
[0006] Receive the first data packet sent by the ISP;
[0007] In the case that there is no connection between the first data center and the second electronic device, determining a second data center, and forwarding the first data packet to the second data center; wherein,
[0008] The second electronic device represents an electronic device corresponding to the source address of the first data packet; the second data center represents a data center having a better service quality than the first data center.
[0009] In the above solution, determining the second data center includes:
[0010] Based on the connection tracking record of the data center, a second data center is determined; wherein,
[0011] The connection tracking record of the second data center includes the second electronic device.
[0012] In the above solution, determining the second data center includes:
[0013] Based on the load corresponding to the data center and / or the first distance, the second data center is determined according to the load balancing strategy; wherein,
[0014] The first distance represents a link distance between a data center and the second electronic device.
[0015] In the above scheme, the method further includes:
[0016] Receives the configured load balancing policy.
[0017] In the above scheme, the method further includes:
[0018] Data is exchanged with a data center in a first system; the data exchange is used to synchronize network information of the first system; the first system represents the system in which the first data center is located.
[0019] In the above solution, the network information of the first system includes at least one of the following:
[0020] The network topology of the first system;
[0021] a connection tracking record of a data center within the first system;
[0022] connection statistics of data centers within the first system;
[0023] load information of the data center in the first system;
[0024] A heartbeat packet of a data center within the first system.
[0025] In the above solution, determining the second data center includes:
[0026] Determine whether there is a data center including the second electronic device in the connection tracking record, and obtain a determination result;
[0027] If the judgment result indicates that there is a data center whose connection tracking record includes the second electronic device, determining the data center whose connection tracking record includes the second electronic device as the second data center;
[0028] In the case where the judgment result indicates that there is no data center with a connection tracking record containing the second electronic device, the second data center is determined according to a load balancing strategy based on the load corresponding to the data center and / or the first distance; wherein,
[0029] The first distance represents a link distance between a data center and the second electronic device.
[0030] The embodiment of the present application further provides a traffic distribution device, which is applied to a first electronic device in a first data center, including:
[0031] A first receiving unit, configured to receive a first data packet sent by an ISP;
[0032] A processing unit, configured to determine a second data center and forward the first data packet to the second data center when there is no connection between the first data center and the second electronic device; wherein,
[0033] The second electronic device represents an electronic device corresponding to the source address of the first data packet; the second data center represents a data center having a better service quality than the first data center.
[0034] The present application also provides an electronic device, including: a processor and a memory for storing a computer program that can be run on the processor.
[0035] Wherein, the processor is used to execute the steps of the above-mentioned traffic distribution method when running the computer program.
[0036] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned traffic distribution method are implemented.
[0037] In the solution provided by the embodiment of the present application, a first electronic device in a first data center receives a first data packet sent by an ISP, and when there is no connection between the first data center and the second electronic device, a second data center with a better service quality than the first data center is determined, and the first data packet is forwarded to the second data center; wherein the second electronic device represents the electronic device corresponding to the source address of the first data packet. Compared with the solution in which the ISP determines the data center that provides services, the above solution is a solution in which the data center determines the data center that provides services based on the service quality of each data center. In other words, the data center reschedules the data packet and forwards the data packet to the data center with better service quality, and the data center with better service quality provides services, thereby improving the service quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a flow chart of a method for implementing a flow distribution method according to an embodiment of the present application;
[0039] Figure 2 A schematic diagram of a flow chart of a method for implementing a flow distribution method according to an embodiment of the present application;
[0040] Figure 3 A schematic diagram of the architecture provided for an embodiment of the present application;
[0041] Figure 4 A schematic diagram of a global server load balance (GSLB) implementation scheme provided for an application embodiment of the present application;
[0042] Figure 5 A schematic diagram of the architecture provided for the application embodiment of the present application;
[0043] Figure 6 A schematic diagram of the relationship between GSLB components provided for the application embodiment of the present application;
[0044] Figure 7 A schematic diagram of the rescheduling algorithm flow provided for the application embodiment of the present application;
[0045] Figure 8 A schematic diagram of data packet forwarding provided for an application embodiment of the present application;
[0046] Fig. 9 A schematic diagram of the structure of a flow distribution device provided in an embodiment of the present application;
[0047] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] Global Server Load Balance (GSLB) is used to allocate traffic between servers in different regions in the wide area network to ensure access quality. Among the various GSLB implementation schemes, the anycast-based scheme can be applied to all scenarios to avoid flow switching problems and single-point performance bottleneck problems. Anycast, also known as Anycast, is a network addressing and routing strategy that can determine the destination of a data packet based on the routing topology. In actual application scenarios, ISPs can use dynamic routing protocols, such as Open Shortest Path First (OSPF) or Border Gateway Protocol (BGP), to determine the data center that provides services from multiple data centers. In related technologies, there is a problem of poor service quality.
[0049] Based on this, in various embodiments of the present application, a first electronic device in a first data center receives a first data packet sent by an ISP, and when there is no connection between the first data center and the second electronic device, a second data center with a better service quality than the first data center is determined, and the first data packet is forwarded to the second data center; wherein the second electronic device represents the electronic device corresponding to the source address of the first data packet. Compared with the solution in which the ISP determines the data center that provides the service, the above solution is a solution in which the data center determines the data center that provides the service in combination with the service quality of each data center. In other words, the data center reschedules the data packet and forwards the data packet to the data center with better service quality, and the data center with better service quality provides the service, thereby improving the service quality.
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] Figure 1 This is a schematic diagram of the implementation process of the traffic distribution method provided in the embodiment of the present application. The embodiment of the present application provides a traffic distribution method, which is applied to the first electronic device in the first data center, wherein the first electronic device includes but is not limited to electronic devices such as servers and terminals. It includes:
[0052] Step 101: Receive a first data packet sent by an ISP.
[0053] Step 102: When there is no connection between the first data center and the second electronic device, determine a second data center and forward the first data packet to the second data center.
[0054] The second electronic device represents an electronic device corresponding to the source address of the first data packet; and the second data center represents a data center having a better service quality than the first data center.
[0055] For the sake of disaster recovery, service expansion or single computer room capacity, a multi-active architecture can be used to provide business services. The architecture is deployed with at least two data centers, each of which has multiple electronic devices. In order to access business services, the user terminal sends a data packet to the ISP; the ISP receives the data packet sent by the user terminal, calculates the first data center based on the routing protocol, and sends the data packet to the first data center.
[0056] In step 101, the first data center receives a first data packet sent by the ISP, determines whether there is a connection between the electronic device of the first data center and the second electronic device, and obtains a determination result. The second electronic device represents the electronic device corresponding to the source address of the first data packet, that is, the source electronic device of the first data packet, which is usually a user terminal. The first electronic device can be an interface device in the first data center, and the flow distribution method of the embodiment of the present application is implemented by configuring the setting component.
[0057] Here, the first electronic device can determine whether there is a connection between the electronic device in the first data center and the second electronic device based on the connection tracking record of the first data center. Specifically, if the connection tracking record of the first data center includes the second electronic device, it is considered that there is a connection between the first data center and the second electronic device; if the connection tracking record of the first data center does not include the second electronic device, it is considered that there is no connection between the first data center and the second electronic device.
[0058] In step 102, when the judgment result indicates that there is no connection between the electronic device in the first data center and the second electronic device, based on the set policy, the first electronic device determines a data center in the first system in which it is located, and the data center provides services for the second electronic device. Here, it can be determined whether there is a connection with the second electronic device based on the connection tracking record of the first data center.
[0059] The setting strategy includes at least one of the following: whether it is in a live state; whether it is connected to the user terminal; load level; link distance. Generally, a data center that is in a live state, connected to the user terminal, has a lower load and / or a closer link distance provides a higher quality of service.
[0060] When the determined data center is not the first data center, that is, a second data center that is better than the first data center is determined, and the first data packet is forwarded to the second data center. In this way, compared with the solution in which the ISP determines the data center that provides services, the above solution is a solution in which the data center determines the data center that provides services based on the service quality of each data center. In other words, the data center reschedules the data packets and forwards the data packets to the data center with better service quality, and the data center with better service quality provides services, thereby improving the service quality. In addition, the embodiment of the present application can improve the service quality at a low cost without changing the ISP settings while achieving traffic distribution.
[0061] When the determined data center is the first data center, the first electronic device receives the first data packet, and the first data center provides services to the user terminal.
[0062] like Figure 2 The flow chart of the implementation flow of the flow distribution method shown is as an embodiment of the present application, and the method further includes:
[0063] Step 201: Data interaction with a data center in a first system.
[0064] The data interaction is used to synchronize network information of the first system; the first system represents the system where the first data center is located.
[0065] By configuring the setting component, the first electronic device of the first data center exchanges data with other data centers in the first system to synchronize the network information of the first system. In this way, the first data center can learn the real-time status of the data center in the first system, thereby determining a second data center that is superior to the first data center.
[0066] As an embodiment of the present application, the network information of the first system includes at least one of the following:
[0067] The network topology of the first system;
[0068] a connection tracking record of a data center within the first system;
[0069] connection statistics of data centers within the first system;
[0070] load information of the data center in the first system;
[0071] A heartbeat packet of a data center within the first system.
[0072] Among them, the network topology of the first system can be used for link calculation, the connection tracking records and connection statistics of the data center can be used to determine whether there is a connection, the load information of the data center can be used to allocate the data center, and the heartbeat data packet can be used to determine whether the data center is in a survival state.
[0073] In practical applications, such as Figure 3 In the schematic diagram of the architecture shown, a user sends a data packet to an ISP; the ISP calculates a first data center based on the routing topology and forwards the data packet to the first data center; the first data center receives the data packet, and an electronic device configured with a GSLB component determines whether to receive, discard, or reschedule the data packet. When determining to reschedule the data packet, the electronic device in the first data center forwards the data packet to the electronic device in the second data center. Here, there is data interaction such as data synchronization and heartbeat detection between the data centers.
[0074] As an embodiment of the present application, determining the second data center in step 102 includes:
[0075] Based on the connection tracking record of the data center, a second data center is determined; wherein,
[0076] The connection tracking record of the second data center includes the second electronic device.
[0077] Due to changes in network status, the ISP's routing calculation results may change, and subsequent data packets of a connection or session may be sent to another data center with no connection established.
[0078] The first electronic device determines whether there is a data center whose connection tracking record includes the second electronic device based on the connection tracking record of the data center within the first system, and determines the data center whose connection tracking record includes the second electronic device as the second data center. The connection tracking record is used to track and record the connection status, and can determine whether there is a connection / session relationship between the data center and the second electronic device that sent the first data packet. In this way, the data center that is connected to the second electronic device is determined as the second data center, and the second data center provides services for the second electronic device, avoiding connection resets caused by the lack of session information in the data center; ensuring that the data center can provide services normally in the event of network changes, so that the system can be generally applicable to various network environments, improving the robustness of the system.
[0079] As an embodiment of the present application, determining the second data center in step 102 includes:
[0080] Based on the load corresponding to the data center and / or the first distance, the second data center is determined according to the load balancing strategy; wherein,
[0081] The first distance represents a link distance between a data center and the second electronic device.
[0082] According to the load balancing strategy, the first electronic device determines a second data center that provides services for the second electronic device based on the load of the data center in the first system and / or the link distance with the second electronic device. Here, the data center can be determined according to the load balancing strategy. The link distance can be used as a basis to determine the data center with the closest link distance as the second data center; the load can be used as a basis to determine the data center with the smallest load as the second data center; or both the load and the link distance can be used as a basis. Generally, the data center with lower load and / or closer link distance provides higher service quality.
[0083] As an embodiment of the present application, the method further includes:
[0084] Receives the configured load balancing policy.
[0085] The first electronic device receives the load balancing strategy configured by the operation and maintenance personnel through the interface, and determines the second data center according to the load balancing strategy configured by the operation and maintenance personnel. The operation and maintenance personnel configure the load balancing strategy, which improves the flexibility of providing services.
[0086] As an embodiment of the present application, determining the second data center in step 102 includes:
[0087] Determine whether there is a data center including the second electronic device in the connection tracking record, and obtain a determination result;
[0088] If the judgment result indicates that there is a data center whose connection tracking record includes the second electronic device, determining the data center whose connection tracking record includes the second electronic device as the second data center;
[0089] In the case where the judgment result indicates that there is no data center with a connection tracking record containing the second electronic device, the second data center is determined according to a load balancing strategy based on the load corresponding to the data center and / or the first distance; wherein,
[0090] The first distance represents a link distance between a data center and the second electronic device.
[0091] The first electronic device determines, based on the connection tracking record of the data center in the first system, whether there is a data center in the first system whose connection tracking record includes the second electronic device.
[0092] If there exists a data center whose connection tracking record includes the second electronic device in the first system, the first electronic device determines this data center as the second data center.
[0093] If there is no data center with a connection tracking record containing the second electronic device in the first system, the first electronic device determines a second data center providing services for the second electronic device according to a load balancing strategy based on the load of the data center in the first system and / or the link distance to the second electronic device.
[0094] In the embodiment of the present application, the first electronic device first determines the connection relationship between the data center in the first system and the second electronic device, determines the data center that is connected to the second electronic device as the second data center, and forwards the data packet to the second data center, so that the connection reset caused by the change of the ISP routing calculation result can be avoided. In the case that there is no data center connected to the second electronic device in the first system, the first data packet is the data packet requested to be sent by the second electronic device for the first time; the first electronic device then determines the second data center with high service quality for the second electronic device based on the load of the data center in the first system and / or the link distance with the second electronic device, thereby improving the service quality.
[0095] The present application is further described in detail below in conjunction with application examples.
[0096] The current popular GSLB implementation solutions have the following problems:
[0097] 1) Solutions based on smart DNS.
[0098] For example, in a multi-active scenario, when a data center fails, even if the authoritative server is updated immediately and the IP address of the failed data center is no longer returned, the request will still be sent to the failed data center for a period of time (ranging from a few minutes to a few hours) due to the client's DNS cache (such as the browser, operating system), ISPDNS, or public DNS service cache, resulting in request failure.
[0099] 2) Anycast-based solution.
[0100] The load strategy is not flexible and the load is not balanced. This is because the dynamic routing protocol used by ISP allocation only considers the shortest link distance from the user to the data center. In the multi-active scenario, due to the uneven distribution of users in different regions, the data center near the area with too many users is overloaded, while the data centers in other areas are relatively idle, resulting in load imbalance.
[0101] The data packet may be sent to the wrong server. Since the ISP's BGP uses a dynamic routing protocol (such as OSPF or BGP), the route may be recalculated during a connection, resulting in a change in the route. Subsequent data packets on the same TCP connection are sent to a different server. Since the connection or session does not exist on the new server, the established TCP connection will be reset incorrectly, and messages cannot be sent normally, and normal conversations cannot be carried out.
[0102] OSPF is a routing protocol based on IP protocol and is a widely used IGP protocol on large and medium-sized networks. OSPF is an implementation of link-state routing protocol and operates within an autonomous system.
[0103] BGP is a core decentralized autonomous routing protocol on the Internet. It achieves reachability between autonomous systems (AS) by maintaining IP routing tables or "prefix" tables, and is a vector routing protocol.
[0104] 3) A solution based on reverse proxy and triangular transmission mode Direct Routing.
[0105] There is a single point performance bottleneck problem.
[0106] 4) Solutions based on HTTP redirection and unified scheduling service layer.
[0107] The usage scenarios are limited. For example, HTTP redirection is only applicable to the HTTP protocol; the unified scheduling service layer requires the participation of the client, which basically excludes the browser.
[0108] Based on this, this application embodiment improves the defects of the existing solution, optimizes it based on Anycast, implements Stabilized Anycast, and proposes a new GSLB implementation solution, such as Figure 4 Based on the survival status of each data center, connection tracking, actual load, distance from the user terminal, user-configured scheduling strategy and other factors, data packets are rescheduled to ensure that the load of each data center is relatively balanced and to effectively avoid sending data packets to the wrong server, ultimately ensuring the user's access quality.
[0109] Combine the following Figure 5 , explain the key processes and algorithms involved in this solution:
[0110] 1) Data synchronization and heartbeat detection.
[0111] As shown in the overall architecture, this GSLB implementation is distributed, with a GSLB component deployed in each data center. Figure 6 As shown, the relationship between these GSLB components is equal, and data synchronization and heartbeat detection are performed between each other:
[0112] Data synchronization enables each GSLB component to have a global view of the system, thereby achieving more balanced load scheduling. The synchronized data includes connection tracking records, connection statistics, virtual service load, etc. A certain delay is allowed during the synchronization process, but the impact is small.
[0113] Heartbeat detection can be used to detect whether GSLB components or data centers are faulty, so that these faulty data centers can be skipped during rescheduling.
[0114] 2) Rescheduling.
[0115] When a GSLB component receives a client data packet, if the data packet has not established a connection or session with itself, or there are other data centers with better service quality, the GSLB component will reschedule the data packet and forward it to other data centers.
[0116] here, Figure 7 A rescheduling algorithm flow is shown.
[0117] 3) Data forwarding.
[0118] In addition to configuring the VIP network port, it is best to configure an additional internal communication port for each GSLB component. Using the internal communication port for data forwarding can improve the throughput of the entire system.
[0119] like Figure 8 As shown, currently data packet forwarding can be implemented based on tunnel technology, such as using protocols such as GRE (Generic Routing Encapsulation) and VXLAN (Virtual eXtensible Local Area Network).
[0120] This application embodiment proposes a GSLB implementation solution based on Anycast, which effectively solves the problems existing in the current mainstream solutions, such as the inflexible load strategy of the Anycast solution, load imbalance, and connection reset due to incorrect data packet transmission.
[0121] Here, the architecture of this application embodiment is tested, and GSLB components are deployed in two data centers. The two data centers are subjected to continuous stress testing, with the number of concurrent requests of the first data center being 200 and the number of concurrent requests of the second data center being 100; it can be observed that the load of the backend services of the two data centers is basically the same. A TCP connection is established for the backend service of the first data center, and messages are continuously sent; a scenario of BGP route changes is constructed so that messages are sent to the second data center, and it can be observed that the messages can still be sent successfully and the connection will not be reset by the server.
[0122] To implement the method of the embodiment of the present application, the embodiment of the present application further provides a flow distribution device, which is applied to a first electronic device in a first data center, such as Fig. 9 As shown, the device comprises:
[0123] The first receiving unit 901 is used to receive a first data packet sent by an ISP;
[0124] The processing unit 902 is configured to determine a second data center and forward the first data packet to the second data center when there is no connection between the first data center and the second electronic device; wherein:
[0125] The second electronic device represents an electronic device corresponding to the source address of the first data packet; the second data center represents a data center having a better service quality than the first data center.
[0126] In one embodiment, the processing unit 902 is used to:
[0127] Based on the connection tracking record of the data center, a second data center is determined; wherein,
[0128] The connection tracking record of the second data center includes the second electronic device.
[0129] In one embodiment, the processing unit 902 is configured to:
[0130] Based on the load corresponding to the data center and / or the first distance, the second data center is determined according to the load balancing strategy; wherein,
[0131] The first distance represents a link distance between a data center and the second electronic device.
[0132] In one embodiment, the apparatus further comprises:
[0133] The second receiving unit is used to receive the configured load balancing strategy.
[0134] In one embodiment, the apparatus further comprises:
[0135] The transceiver unit is used for data exchange with a data center in a first system; the data exchange is used for synchronizing network information of the first system; the first system represents the system in which the first data center is located.
[0136] In one embodiment, the network information of the first system includes at least one of the following:
[0137] The network topology of the first system;
[0138] a connection tracking record of a data center within the first system;
[0139] connection statistics of data centers within the first system;
[0140] load information of the data center in the first system;
[0141] A heartbeat packet of a data center within the first system.
[0142] In one embodiment, the processing unit 902 is configured to:
[0143] Determine whether there is a data center including the second electronic device in the connection tracking record, and obtain a determination result;
[0144] If the judgment result indicates that there is a data center whose connection tracking record includes the second electronic device, determining the data center whose connection tracking record includes the second electronic device as the second data center;
[0145] In the case where the judgment result indicates that there is no data center with a connection tracking record containing the second electronic device, the second data center is determined according to a load balancing strategy based on the load corresponding to the data center and / or the first distance; wherein,
[0146] The first distance represents a link distance between a data center and the second electronic device.
[0147] In actual application, the processing unit 902 and the second receiving unit can be implemented by a processor in the traffic distribution device combined with a communication interface, and the first receiving unit 901 and the transceiver unit can be implemented by a communication interface in the traffic distribution device.
[0148] It should be noted that: the flow distribution device provided in the above embodiment only uses the division of the above program modules as an example when performing flow distribution. In actual applications, the above processing distribution can be completed by different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the flow distribution device provided in the above embodiment and the flow distribution method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0149] Based on the hardware implementation of the above program modules, and in order to implement the traffic distribution method of the embodiment of the present application, the embodiment of the present application also provides an electronic device. Fig.10 Schematic diagram of the hardware structure of the electronic device of the present application embodiment. Fig.10 As shown, the electronic equipment includes:
[0150] Communication interface 1, capable of exchanging information with other devices such as network devices;
[0151] The processor 2 is connected to the communication interface 1 to implement information exchange with other devices and is used to execute the method provided by one or more of the above technical solutions when running a computer program. The computer program is stored in the memory 3.
[0152] Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.10 Various buses are labeled as bus system 4.
[0153] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0154] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 2 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.
[0155] The method disclosed in the above embodiment of the present application can be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 2 or the instruction in the form of software. The above processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 3, and the processor 2 reads the program in the memory 3 and completes the steps of the above method in combination with its hardware.
[0156] When the processor 2 executes the program, the corresponding processes in the various methods of the embodiments of the present application are implemented, which will not be repeated here for the sake of brevity.
[0157] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, a memory 3 storing a computer program, and the computer program can be executed by a processor 2 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0158] In the several embodiments provided in the present application, it should be understood that the disclosed devices, electronic devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0159] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0160] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0161] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0162] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0163] It is understandable that if user information is involved in the embodiments of the present application, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0164] It should be noted that the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict. Unless otherwise specified and limited, the term "connection" should be understood in a broad sense, for example, it can be an electrical connection, or it can be the internal connection of two components, it can be a direct connection, or it can be an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0165] In addition, in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the objects distinguished by "first\second\third" can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0166] The term "and / or" herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality. For example, at least one of A, B, and C can represent any one or more elements selected from the set consisting of A, B, and C.
[0167] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0168] The various specific technical features in the various embodiments described in the specific implementation methods can be combined in various ways without contradiction. For example, different implementation methods can be formed by combining different specific technical features. In order to avoid unnecessary repetition, the various possible combinations of the specific technical features in this application will not be described separately.
Claims
1. A flow distribution method, characterized in that: Applied to a first electronic device in a first data center, the method includes: Receiving a first data packet sent by an Internet service provider ISP; In the case that there is no connection between the first data center and the second electronic device, determining a second data center, and forwarding the first data packet to the second data center; wherein, The second electronic device represents the electronic device corresponding to the source address of the first data packet; the second data center is a data center that is connected to the second electronic device and has better service quality than the first data center, and whether there is a connection between the data center and the second electronic device is determined based on whether the connection tracking record of the data center includes the second electronic device.
2. The method according to claim 1, characterized in that The determining the second data center includes: Based on the connection tracking record of the data center, a second data center is determined; wherein, The connection tracking record of the second data center includes the second electronic device.
3. The method according to claim 1, characterized in that: The determining the second data center includes: Based on the load corresponding to the data center and / or the first distance, the second data center is determined according to the load balancing strategy; wherein, The first distance represents a link distance between a data center and the second electronic device.
4. The method according to claim 3, characterized in that The method further comprises: Receives the configured load balancing policy.
5. The method according to claim 1, characterized in that The method further comprises: Data is exchanged with a data center in a first system; the data exchange is used to synchronize network information of the first system; the first system represents the system in which the first data center is located.
6. The method according to claim 5, characterized in that The network information of the first system includes at least one of the following: The network topology of the first system; a connection tracking record of a data center within the first system; connection statistics of data centers within the first system; load information of the data center in the first system; A heartbeat packet of a data center within the first system.
7. The method according to claim 1, characterized in that The determining the second data center includes: Determine whether there is a data center including the second electronic device in the connection tracking record, and obtain a determination result; If the judgment result indicates that there is a data center whose connection tracking record includes the second electronic device, determining the data center whose connection tracking record includes the second electronic device as the second data center; In the case where the judgment result indicates that there is no data center with a connection tracking record containing the second electronic device, the second data center is determined according to a load balancing strategy based on the load corresponding to the data center and / or the first distance; wherein, The first distance represents a link distance between a data center and the second electronic device.
8. A flow distribution device, characterized in that: A first electronic device used in a first data center includes: A first receiving unit, configured to receive a first data packet sent by an ISP; A processing unit, configured to determine a second data center and forward the first data packet to the second data center when there is no connection between the first data center and the second electronic device; wherein, The second electronic device represents the electronic device corresponding to the source address of the first data packet; the second data center is a data center that is connected to the second electronic device and has better service quality than the first data center, and whether there is a connection between the data center and the second electronic device is determined based on whether the connection tracking record of the data center includes the second electronic device.
9. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
