Traffic sharing method and device, computer device and storage medium
Patent Information
- Application Number
- CN202411786896.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-12-06
AI Technical Summary
[0003]该方式虽然能够完成数据的外发,但当子网中存在较多数据需要外发,或者,存在多个子网需要同时外发数据的情况下,网关设备通常会因为传输数量较多导致设备故障的情况
[0048] The aforementioned traffic sharing method, apparatus, computer equipment, and storage medium, in response to first traffic data sent from a subnet under a virtual private cloud, determine the source Internet Protocol (IP) address of the subnet corresponding to the first traffic data; based on the source IP address of the subnet, determine whether the first traffic data needs to be transmitted to a backup device; if the first traffic data does not need to be transmitted to the backup device, convert the source IP address of the subnet in the first traffic data to a public IP address to update the first traffic data; and based on the public IP address, transmit the updated first traffic data over the public network. This embodiment can fully utilize the backup device to share the processing of traffic data when the backup device is not faulty, and at the same time, only one public IP address is needed on the public network side to achieve traffic sharing, thus improving processing efficiency.
Smart Images

Figure CN119583474B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a traffic sharing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the development of cloud computing network virtualization technology, gateway devices have emerged. These gateway devices are typically used to convert data sent from cloud devices on the subnet into data acceptable to the public network and then send that data out from the public network.
[0003] While this method can transmit data, when there is a large amount of data to be transmitted from a subnet, or when multiple subnets need to transmit data simultaneously, the gateway device will often fail due to the large number of data transmissions. Summary of the Invention
[0004] Therefore, it is necessary to provide a traffic sharing method, device, computer equipment, and storage medium that can ensure the normal operation of the equipment in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a traffic sharing method applied to a master device, comprising:
[0006] In response to the first traffic data sent by a subnet under the virtual private cloud, determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data;
[0007] Based on the source IP address of the subnet, determine whether the first traffic data needs to be transmitted to the backup device;
[0008] If the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to the source IP address of the public network to update the first traffic data;
[0009] Based on the public IP address, the updated first traffic data is sent out over the public network.
[0010] In one embodiment, determining whether the first traffic data needs to be transmitted to the backup device based on the source IP address of the subnet includes:
[0011] Determine if the interface identifier in the source IP address of the subnet is odd;
[0012] If the interface identifier in the source IP address of the subnet is odd, it is determined that the first traffic data needs to be transmitted to the backup device.
[0013] In one embodiment, converting the source IP address of the subnet in the first traffic data to the source IP address of the public network includes:
[0014] Perform security checks on the first flow data and obtain the check results;
[0015] If the detection result is satisfactory, the source IP address of the subnet corresponding to the first traffic data will be converted to the source IP address of the public network.
[0016] In one embodiment, the method further includes:
[0017] If the first traffic data needs to be transmitted to the backup device, the first traffic data is sent to the backup device so that the backup device can convert the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device, and obtain the second traffic data.
[0018] Upon receiving the second traffic data from the backup device, the source IP address in the second traffic data is converted to a public source IP address to update the second traffic data; based on the public source IP address, the updated second traffic data is sent out over the public network.
[0019] Secondly, this application provides a traffic sharing method applied to backup equipment, including:
[0020] In response to the first traffic data sent by the master device, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data; wherein, the first traffic data is the first traffic data sent by the master device in response to the subnet under the virtual private cloud, and the sending is controlled according to the source IP address of the subnet corresponding to the first traffic data.
[0021] The second traffic data is transmitted to the main device through a preset routing configuration, so that the main device can convert the source IP address in the second traffic data into a public source IP address and then send the second traffic data out over the public network.
[0022] In one embodiment, the source IP address of the subnet corresponding to the traffic data is converted to the source IP address of the backup device to obtain the second traffic data, including:
[0023] Perform security checks on the first flow data and obtain the check results;
[0024] If the detection result is satisfactory, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data.
[0025] Thirdly, this application also provides a flow-sharing device applied to a main device, comprising:
[0026] The address determination module is used to determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data sent by the subnet under the virtual private cloud in response to the first traffic data.
[0027] The transmission judgment module is used to determine whether the first traffic data needs to be transmitted to the backup device based on the source IP address of the subnet;
[0028] The address update module is used to update the first traffic data by converting the source IP address of the subnet in the first traffic data to the source IP address of the public network when the first traffic data does not need to be transmitted to the backup device.
[0029] The data outbound module is used to outbound the updated first traffic data via the public network based on the source IP address on the public network.
[0030] Fourthly, this application also provides a flow-sharing device for use in backup equipment, comprising:
[0031] The data receiving module is used to respond to the first traffic data sent by the master device, convert the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device, and obtain the second traffic data; wherein, the first traffic data is the first traffic data sent by the master device in response to the subnet under the virtual private cloud, and the sending is controlled according to the source IP address of the subnet corresponding to the first traffic data.
[0032] The data transmission module is used to transmit the second traffic data to the main device through a preset routing configuration, so that the main device can convert the source IP address in the second traffic data into a public source IP address and send the second traffic data out over the public network.
[0033] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0034] In response to the first traffic data sent by a subnet under the virtual private cloud, determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data;
[0035] Based on the source IP address of the subnet, determine whether the first traffic data needs to be transmitted to the backup device;
[0036] If the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to the source IP address of the public network to update the first traffic data;
[0037] Based on the public IP address, the updated first traffic data is sent out over the public network.
[0038] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0039] In response to the first traffic data sent by a subnet under the virtual private cloud, determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data;
[0040] Based on the source IP address of the subnet, determine whether the first traffic data needs to be transmitted to the backup device;
[0041] If the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to the source IP address of the public network to update the first traffic data;
[0042] Based on the public IP address, the updated first traffic data is sent out over the public network.
[0043] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0044] In response to the first traffic data sent by a subnet under the virtual private cloud, determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data;
[0045] Based on the source IP address of the subnet, determine whether the first traffic data needs to be transmitted to the backup device;
[0046] If the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to the source IP address of the public network to update the first traffic data;
[0047] Based on the public IP address, the updated first traffic data is sent out over the public network.
[0048] The aforementioned traffic sharing method, apparatus, computer equipment, and storage medium, in response to first traffic data sent from a subnet under a virtual private cloud, determine the source Internet Protocol (IP) address of the subnet corresponding to the first traffic data; based on the source IP address of the subnet, determine whether the first traffic data needs to be transmitted to a backup device; if the first traffic data does not need to be transmitted to the backup device, convert the source IP address of the subnet in the first traffic data to a public IP address to update the first traffic data; and based on the public IP address, transmit the updated first traffic data over the public network. This embodiment can fully utilize the backup device to share the processing of traffic data when the backup device is not faulty, and at the same time, only one public IP address is needed on the public network side to achieve traffic sharing, thus improving processing efficiency. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is an application environment diagram of a traffic sharing method provided in this embodiment;
[0051] Figure 2 A flowchart illustrating the first traffic sharing method provided in this embodiment;
[0052] Figure 3 This is a flowchart illustrating the second traffic sharing method provided in this embodiment;
[0053] Figure 4 This is a structural block diagram of the first type of flow sharing device provided in this embodiment;
[0054] Figure 5 This is a structural block diagram of the second type of flow sharing device provided in this embodiment;
[0055] Figure 6 This is an internal structural diagram of a computer device provided in this embodiment. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0057] The traffic sharing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the master device 100 responds to the first traffic data sent by the subnet under the virtual private cloud, determines the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data; based on the source IP address of the subnet, it determines whether the first traffic data needs to be transmitted to the backup device 101; if the first traffic data does not need to be transmitted to the backup device 101, it converts the source IP address of the subnet in the first traffic data to the source IP address of the public network to update the first traffic data; based on the source IP address of the public network, it sends the updated first traffic data out over the public network.
[0058] In one exemplary embodiment, such as Figure 2 As shown, a traffic sharing method is provided, which is applied to... Figure 1 Taking the main device 100 as an example, the explanation includes the following steps 201 to 204. Wherein:
[0059] Step 201: In response to the first traffic data sent by the subnet under the virtual private cloud, determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data.
[0060] Specifically, the main device adds rules to obtain the first traffic data sent by all subnets under the virtual private cloud, and determines the source Internet Protocol Address (IP) of the subnet corresponding to the first traffic data.
[0061] Step 202: Determine whether the first traffic data needs to be transmitted to the backup device based on the source IP address of the subnet.
[0062] In one embodiment, the parity of the IP address is marked according to the source IP address of the subnet; it is determined whether the mark corresponding to the source IP address of the subnet is odd or even. If it is odd, it is determined that the first traffic data needs to be transmitted to the backup device; if it is even, it is determined that the first traffic data does not need to be transmitted to the backup device.
[0063] In another embodiment, determining whether the first traffic data needs to be transmitted to the backup device based on the source IP address of the subnet includes: determining whether the interface identifier in the source IP address of the subnet is odd; if the interface identifier in the source IP address of the subnet is odd, determining that the first traffic data needs to be transmitted to the backup device; if the interface identifier in the source IP address of the subnet is even, determining that the first traffic data does not need to be transmitted to the backup device.
[0064] Step 203: If the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to the source IP address of the public network to update the first traffic data.
[0065] In one embodiment, when the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet corresponding to the five-tuple in the first traffic data is converted to the public source IP address through Source Network Address Translation (SNAT), and the first traffic data is updated.
[0066] In another embodiment, the first traffic data is subjected to security detection to obtain the detection result; if the detection result is passed, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the public network.
[0067] Specifically, the first traffic data undergoes security checks (such as virus protection and intrusion prevention) to obtain the check results; if the check results are satisfactory, the source IP address of the subnet corresponding to the first traffic data in the five-tuple is converted to the public source IP address through source network address translation.
[0068] It should be noted that this embodiment also includes: when the first traffic data needs to be transmitted to the backup device, sending the first traffic data to the backup device so that the backup device converts the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device to obtain the second traffic data; when receiving the second traffic data fed back by the backup device, converting the source IP address in the second traffic data into the source IP address of the public network to update the second traffic data; and sending the updated second traffic data outward through the public network based on the source IP address of the public network.
[0069] Specifically, when the first traffic data needs to be transmitted to the backup device, the first traffic data is sent to the backup device through the configured routing policy; the backup device converts the source IP address of the subnet corresponding to the first traffic data into the backup device's source IP address to obtain the second traffic data; the backup device sends the second traffic data to the master device; upon receiving the second traffic data from the backup device, the master device converts the source IP address in the second traffic data into a public network source IP address and updates the second traffic data; based on the public network source IP address, the master device sends the updated second traffic data out over the public network.
[0070] Step 204: Based on the public source IP address, send the updated first traffic data out over the public network.
[0071] For example, such as Figure 1 The blue arrows in the diagram illustrate the application environment of the traffic sharing method. When the primary device's IP1 port responds to the first traffic data sent from the subnet under the virtual private cloud, it determines the source Internet Protocol (IP) address of the subnet corresponding to the first traffic data and whether the source IP address is odd. If the interface identifier in the subnet's source IP address is even, it is determined that the first traffic data does not need to be transmitted to the backup device. A security check is performed on the first traffic data, and the check result is obtained. If the check result is successful, the source IP address of the subnet corresponding to the first traffic data is converted to a public IP address. Based on the public IP address, the updated first traffic data is sent to the public network through the primary device's IP3 port. If the interface identifier in the subnet's source IP address is odd, the primary device forwards the first traffic data with an odd source IP address to the backup device's IP2 port through its IP1 port.
[0072] It should be noted that this embodiment also includes the return data corresponding to the traffic data that was previously routed through the main device. After the return data returns to the main device through the public network, the return data is further subjected to security checks. After the security check is passed, the destination IP address in the five-tuple corresponding to the return data is converted to the destination IP address of the subnet, and then the return data is transmitted back to the corresponding subnet under the virtual private cloud.
[0073] The aforementioned traffic sharing method, in response to first traffic data sent from a subnet under a virtual private cloud, determines the source Internet Protocol (IP) address of the subnet corresponding to the first traffic data; based on the source IP address of the subnet, it determines whether the first traffic data needs to be transmitted to a backup device; if the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to a public IP address to update the first traffic data; based on the public IP address, the updated first traffic data is sent out over the public network. This embodiment can fully utilize the backup device to share the processing of traffic data when the backup device is not faulty, and at the same time, only one public IP address is needed on the public network side to achieve traffic sharing, thus improving processing efficiency.
[0074] In one exemplary embodiment, such as Figure 3 As shown, a traffic sharing method is provided, which is applied to... Figure 1 Taking backup device 101 as an example, the explanation includes the following steps 301 to 302. Wherein:
[0075] Step 301: In response to the first traffic data sent by the master device, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data.
[0076] Among them, the first traffic data is the first traffic data sent by the master device in response to the subnet under the virtual private cloud, and the sending is controlled according to the source IP address of the subnet corresponding to the first traffic data;
[0077] In one embodiment, the backup device responds to the first traffic data sent by the master device; at the egress conversion port, it converts the source IP address of the subnet corresponding to the first traffic data to the source IP address of the backup device to obtain the second traffic data.
[0078] In another embodiment, the first traffic data is subjected to security detection to obtain the detection result; if the detection result is passed, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data.
[0079] Specifically, the first traffic data undergoes security checks (such as virus protection and intrusion prevention) to obtain the check results. If the check results are satisfactory, the source IP address of the subnet corresponding to the first traffic data in the five-tuple is converted to the source IP address of the corresponding output port of the backup device through source network address translation to obtain the second traffic data.
[0080] Step 302: The second traffic data is transmitted to the master device through a preset routing configuration, so that the master device can convert the source IP address in the second traffic data into a public source IP address and send the second traffic data out over the public network.
[0081] Specifically, the backup device transmits the second traffic data to the master device through a preset routing configuration; the master device converts the source IP address in the second traffic data into a public source IP address and then sends the second traffic data out over the public network.
[0082] For example, such as Figure 1 The red arrows in the diagram illustrate the application environment of the traffic sharing method. The backup device's IP2 port responds to the first traffic data sent by the primary device's corresponding IP1 port, performs a security check on the first traffic data, and obtains the check result. If the check passes, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device's corresponding IP4 port, resulting in the second traffic data. Based on a preset routing configuration, the second traffic data is transmitted to the primary device's IP3 port via the backup device's corresponding IP4 port. The primary device's IP3 port converts the source IP address in the second traffic data to a public network source IP address and then forwards the second traffic data to the public network via the primary device's IP3 port.
[0083] It should be noted that this embodiment also includes the return data corresponding to the traffic data that was previously routed through the backup device. After the return data returns to the IP3 port of the primary device via the public network, the destination IP address in the five-tuple corresponding to the return data is converted to the destination IP address of the IP4 port of the backup device, and the return data is updated. The updated return data is forwarded to the IP4 port of the backup device through the IP3 port of the primary device. After receiving the return data, the IP4 port of the backup device further performs security checks on the return data. After the security check is passed, the destination IP address of the IP4 port of the backup device in the five-tuple corresponding to the return data is converted to the destination IP address of the subnet, and then the return data is transmitted back to the corresponding subnet under the virtual private cloud.
[0084] The aforementioned traffic sharing method, in response to the first traffic data sent by the master device, converts the source IP address of the subnet corresponding to the first traffic data to the source IP address of the backup device, obtaining the second traffic data. The second traffic data is then transmitted to the master device via a preset routing configuration, allowing the master device to convert the source IP address in the second traffic data to a public network source IP address and transmit the second traffic data over the public network. This embodiment can fully utilize the backup device to share the traffic data processing when the backup device is functioning correctly, and only requires a single public network IP address on the public network side to achieve traffic sharing, thus improving processing efficiency.
[0085] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0086] Based on the same inventive concept, this application also provides a traffic sharing device for implementing the traffic sharing method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more traffic sharing device embodiments provided below can be found in the limitations of the traffic sharing method described above, and will not be repeated here.
[0087] In one exemplary embodiment, such as Figure 4 As shown, a traffic sharing device is provided, including: an address determination module 10, a transmission judgment module 11, an address update module 12, and a data transmission module 13, wherein:
[0088] Address determination module 10 is used to determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data in response to the first traffic data sent by the subnet under the virtual private cloud.
[0089] The transmission judgment module 11 is used to determine whether the first traffic data needs to be transmitted to the backup device based on the source IP address of the subnet;
[0090] Address update module 12 is used to update the first traffic data by converting the source IP address of the subnet in the first traffic data to the source IP address of the public network when the first traffic data does not need to be transmitted to the backup device.
[0091] The data outgoing module 13 is used to send the updated first traffic data out over the public network based on the source IP address of the public network.
[0092] In one embodiment, the transmission determination module 11 is further configured to determine whether the interface identifier in the source IP address of the subnet is odd; if the interface identifier in the source IP address of the subnet is odd, it is determined that the first traffic data needs to be transmitted to the backup device.
[0093] In one embodiment, the address update module 12 is further configured to perform security detection on the first traffic data and obtain a detection result; if the detection result is passed, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the public network.
[0094] In one embodiment, the traffic sharing device is further configured to, when the first traffic data needs to be transmitted to the backup device, send the first traffic data to the backup device so that the backup device converts the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device to obtain the second traffic data; upon receiving the second traffic data fed back by the backup device, convert the source IP address in the second traffic data into the source IP address of the public network to update the second traffic data; and based on the source IP address of the public network, send the updated second traffic data out through the public network.
[0095] In one exemplary embodiment, such as Figure 4 As shown, a traffic sharing device is provided, including: a data receiving module 20 and a data transmission module 21, wherein:
[0096] The data receiving module 20 is used to respond to the first traffic data sent by the master device, convert the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device, and obtain the second traffic data; wherein, the first traffic data is the first traffic data sent by the master device in response to the subnet under the virtual private cloud, and the sending is controlled according to the source IP address of the subnet corresponding to the first traffic data.
[0097] The data transmission module 21 is used to transmit the second traffic data to the master device through a preset routing configuration, so that the master device can convert the source IP address in the second traffic data into a public source IP address and send the second traffic data out over the public network.
[0098] In one embodiment, the data receiving module 20 is further configured to perform security detection on the first traffic data and obtain a detection result; if the detection result is passed, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data.
[0099] Each module in the aforementioned traffic sharing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0100] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a traffic-sharing method.
[0101] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0102] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0103] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0104] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0105] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0106] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0107] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0108] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A traffic sharing method, characterized in that, Applied to a master device, the method includes: In response to the first traffic data sent by a subnet under a virtual private cloud, determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data; Determine whether the interface identifier in the source IP address of the subnet is odd; if the interface identifier in the source IP address of the subnet is odd, determine that the first traffic data needs to be transmitted to the backup device; if the interface identifier in the source IP address of the subnet is even, determine that the first traffic data does not need to be transmitted to the backup device; or, mark the parity of the IP address according to the source IP address of the subnet; determine whether the mark corresponding to the source IP address of the subnet is odd or even; if it is odd, determine that the first traffic data needs to be transmitted to the backup device; if it is even, determine that the first traffic data does not need to be transmitted to the backup device. If the first traffic data does not need to be transmitted to the backup device, the source IP address of the subnet in the first traffic data is converted to the source IP address of the public network to update the first traffic data; and, Based on the source IP address of the public network, the updated first traffic data is sent out through the public network; If the first traffic data needs to be transmitted to the backup device, the first traffic data is sent to the backup device so that the backup device can convert the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device, thereby obtaining the second traffic data. Upon receiving the second traffic data from the backup device, the source IP address in the second traffic data is converted to a public source IP address to update the second traffic data; based on the public source IP address, the updated second traffic data is sent out over the public network. After receiving the return data corresponding to the second traffic data, the destination IP address in the five-tuple corresponding to the return data is converted to the destination IP address corresponding to the backup device, and the return data is updated. The updated return data is forwarded to the backup device so that the backup device can perform security checks on the return data. After the security check is passed, the destination IP address corresponding to the backup device in the five-tuple corresponding to the return data is converted to the destination IP address of the subnet, and the return data is transmitted back to the corresponding subnet under the virtual private cloud.
2. The method according to claim 1, characterized in that, The step of converting the source IP address of the subnet in the first traffic data to the source IP address of the public network includes: The first traffic data is subjected to security detection, and the detection result is obtained; If the detection result is passed, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the public network.
3. A traffic sharing method, characterized in that, Applied to backup equipment, the method includes: In response to the first traffic data sent by the master device, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data; wherein, the first traffic data is the first traffic data sent by the master device in response to the subnet under the virtual private cloud, and the sending is controlled according to the source IP address of the subnet corresponding to the first traffic data; The second traffic data is transmitted to the master device through a preset routing configuration, so that the master device can convert the source IP address in the second traffic data into a public source IP address and send the second traffic data out over the public network. After receiving the return data of the second traffic data sent by the master device, the return data is subjected to security detection. After the security detection is passed, the destination IP address of the backup device in the five-tuple corresponding to the return data is converted to the destination IP address of the subnet, and the return data is transmitted back to the corresponding subnet under the virtual private cloud. The process of the master device controlling the transmission of the first traffic data includes: determining whether the interface identifier in the source IP address of the subnet is odd; if the interface identifier in the source IP address of the subnet is odd, determining that the first traffic data needs to be transmitted to the backup device; if the interface identifier in the source IP address of the subnet is even, determining that the first traffic data does not need to be transmitted to the backup device; or, according to the source IP address of the subnet, marking the parity of the IP address; determining whether the mark corresponding to the source IP address of the subnet is odd or even, if it is odd, determining that the first traffic data needs to be transmitted to the backup device; if it is even, determining that the first traffic data does not need to be transmitted to the backup device.
4. The method according to claim 3, characterized in that, The step of converting the source IP address of the subnet corresponding to the traffic data to the source IP address of the backup device to obtain the second traffic data includes: The first traffic data is subjected to security detection, and the detection result is obtained; If the detection result is passed, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the backup device to obtain the second traffic data.
5. A flow sharing device, characterized in that, Applied to the main equipment, the device includes: The address determination module is used to determine the source Internet Protocol address (IP address) of the subnet corresponding to the first traffic data in response to the first traffic data sent by the subnet under the virtual private cloud. A transmission determination module is used to determine whether the interface identifier in the source IP address of the subnet is odd; if the interface identifier in the source IP address of the subnet is odd, it is determined that the first traffic data needs to be transmitted to the backup device; if the interface identifier in the source IP address of the subnet is even, it is determined that the first traffic data does not need to be transmitted to the backup device; or, based on the source IP address of the subnet, the parity of the IP address is marked; it is determined whether the mark corresponding to the source IP address of the subnet is odd or even; if it is odd, it is determined that the first traffic data needs to be transmitted to the backup device; if it is even, it is determined that the first traffic data does not need to be transmitted to the backup device. The address update module is used to convert the source IP address of the subnet in the first traffic data to the source IP address of the public network when the first traffic data does not need to be transmitted to the backup device, so as to update the first traffic data. The data outgoing module is used to outgoing updated first traffic data via the public network based on the source IP address of the public network; The device is also used for: If the first traffic data needs to be transmitted to the backup device, the first traffic data is sent to the backup device so that the backup device can convert the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device, thereby obtaining the second traffic data. Upon receiving the second traffic data from the backup device, the source IP address in the second traffic data is converted to a public source IP address to update the second traffic data; based on the public source IP address, the updated second traffic data is sent out over the public network. After receiving the return data corresponding to the second traffic data, the destination IP address in the five-tuple corresponding to the return data is converted to the destination IP address corresponding to the backup device, and the return data is updated. The updated return data is forwarded to the backup device so that the backup device can perform security checks on the return data. After the security check is passed, the destination IP address corresponding to the backup device in the five-tuple corresponding to the return data is converted to the destination IP address of the subnet, and the return data is transmitted back to the corresponding subnet under the virtual private cloud.
6. The apparatus according to claim 5, characterized in that, The address update module is also used to perform security detection on the first traffic data and obtain the detection result; if the detection result is successful, the source IP address of the subnet corresponding to the first traffic data is converted to the source IP address of the public network.
7. A flow sharing device, characterized in that, Applied to backup equipment, the device includes: The data receiving module is used to respond to the first traffic data sent by the master device, convert the source IP address of the subnet corresponding to the first traffic data into the source IP address of the backup device, and obtain the second traffic data; wherein, the first traffic data is the first traffic data sent by the master device in response to the subnet under the virtual private cloud, and the sending is controlled according to the source IP address of the subnet corresponding to the first traffic data; The data transmission module is used to transmit the second traffic data to the master device through a preset routing configuration, so that the master device can convert the source IP address in the second traffic data into a public source IP address and send the second traffic data out over the public network. The process of the master device controlling the transmission of the first traffic data includes: determining whether the interface identifier in the source IP address of the subnet is odd; if the interface identifier in the source IP address of the subnet is odd, determining that the first traffic data needs to be transmitted to the backup device; or, marking the parity of the IP address according to the source IP address of the subnet; determining whether the mark corresponding to the source IP address of the subnet is odd or even, and if it is odd, determining that the first traffic data needs to be transmitted to the backup device. The device is further configured to: after receiving the return data of the second traffic data sent by the master device, perform security detection on the return data, and after the security detection is passed, convert the destination IP address of the backup device in the five-tuple corresponding to the return data into the destination IP address of the subnet, and transmit the return data back to the corresponding subnet under the virtual private cloud.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Network address conversion method and device and address conversion equipment
CN109120746A
Equipment switching method and device, and service system
CN110474802A