Information transmission method and device, electronic equipment and readable storage medium
By storing and forwarding client address information in the TCP packet options field, the problem of the backend server being unable to obtain the real client address under multi-level load balancing devices is solved, enabling the backend server to obtain the client address and facilitating backend server processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2023-04-17
- Publication Date
- 2026-05-19
AI Technical Summary
In scenarios where multi-level load balancers are deployed in series, the backend server cannot obtain the actual client address information. Existing technologies can only obtain the address information of the last-level load balancer through the TOA method.
The client's address information is stored in the TCP packet options field. Multiple load balancers deployed in series forward the TCP packet options field at multiple levels. Finally, the client's address information and the address information of each load balancer are sent to the backend server. The backend server parses and obtains the client's address information.
This enables the backend server to obtain the real client address information, facilitating processing based on the client address information and meeting the needs for user information analysis and tracing.
Smart Images

Figure CN116471275B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an information transmission method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] Currently, load balancing devices perform network address translation (NAT) on user requests, preventing backend servers from obtaining the actual client address. TCP option addresses (TOA) are one way to enable backend servers to obtain the client's address information.
[0003] However, in scenarios where multi-level load balancers are deployed in series, the TOA method can only obtain the address information of the last-level load balancer and cannot obtain the actual client address information. Summary of the Invention
[0004] The purpose of this invention is to provide an information transmission method, apparatus, electronic device, and readable storage medium that can effectively transmit the client's address information to the backend server, so that the backend server can obtain the actual client's address information. The specific technical solution is as follows:
[0005] In a first aspect of the invention, an information transmission method is provided, applied to a system including a load balancing device cluster and a backend server, wherein the load balancing device cluster includes multiple load balancing devices deployed in series, comprising:
[0006] The load balancing device cluster receives user request information sent by the client, including the client's address information; stores the client's address information in the TCP packet options field; and sends the user request information and the TCP packet options field to the backend server. The TCP packet options field includes the client's address information and the address information of each load balancing device.
[0007] The backend server receives user request information and TCP packet option fields sent by the load balancing device cluster; and parses the TCP packet option fields to obtain target address information, which includes the client's address information and the address information of each load balancing device; and retrieves the client's address information from the target address information.
[0008] In a second aspect of the invention, an information transmission method is provided, applied to a load balancing device cluster, the load balancing device cluster comprising multiple load balancing devices deployed in series, including:
[0009] Receive user request information sent by the client, including the client's address information;
[0010] Store the client's address information in the TCP packet options field;
[0011] The user request information and TCP packet option fields are sent to the backend server. The TCP packet option fields include the client's address information and the address information of each load balancer.
[0012] In a third aspect of this invention, an information transmission method is provided, applied to a backend server, comprising:
[0013] Receive user request information and TCP packet option fields sent by the load balancing device cluster;
[0014] Parse the TCP packet options field to obtain the target address information, which includes: the client's address information and the address information of each load balancer in the load balancer cluster;
[0015] Obtain the client's address information from the target address information.
[0016] In a fourth aspect of this invention, an information transmission system is also provided, comprising: a load balancing device cluster and a backend server, wherein the load balancing device cluster includes multiple load balancing devices deployed in series, wherein...
[0017] The load balancing device cluster is used to receive user request information sent by clients, including the client's address information; and to store the client's address information in the TCP packet option field; and to send the user request information and the TCP packet option field to the backend server, wherein the TCP packet option field includes: the client's address information and the address information of each load balancing device.
[0018] The backend server is used to receive user request information and TCP packet option fields sent by the load balancing device cluster; and to parse the TCP packet option fields to obtain target address information, which includes the client's address information and the address information of each load balancing device; and to obtain the client's address information from the target address information.
[0019] In a fifth aspect of the present invention, an information transmission device is also provided, applied to a backend server, comprising:
[0020] The receiving module is used to receive user request information and TCP packet option fields sent by the load balancing device cluster;
[0021] The parsing module is used to parse the TCP packet option field to obtain the target address information, which includes the client's address information and the address information of each load balancer in the load balancer cluster.
[0022] The acquisition module is used to obtain the client's address information from the target address information.
[0023] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the data forwarding methods described above.
[0024] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the information transmission methods described above.
[0025] The information transmission method provided in this embodiment of the invention involves receiving user request information sent by a client. This user request information includes the client's address information. The client's address information is stored in the TCP packet option field, thus the TCP packet option field includes the client's address information. The TCP packet option field undergoes multi-level forwarding via multiple load balancers deployed in series. The TCP packet option field records both the client's address information and the address information of each load balancer that forwards the TCP packet option field. Finally, the user request information and the TCP packet option field are sent to a backend server. Therefore, the TCP packet option field received by the backend server includes both the client's address information and the address information of each load balancer. This allows the backend server to obtain the client's address information from the TCP packet option field, facilitating processing based on the client's address information. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0027] Figure 1 This is a flowchart of an information transmission method provided in an embodiment of the present invention;
[0028] Figure 2 This is a schematic diagram of a TCP packet option field provided in an embodiment of the present invention;
[0029] Figure 3 This is a flowchart of another information transmission method provided in an embodiment of the present invention;
[0030] Figure 4 This is a flowchart of another information transmission method provided in an embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram of the structure of an information transmission system provided in an embodiment of the present invention;
[0032] Figure 6 This is a schematic diagram of the structure of an information transmission device provided in an embodiment of the present invention;
[0033] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0034] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0035] The technical terms used in this invention are explained below:
[0036] A load balancer is a hardware device that distributes network requests across available servers in a server cluster by managing incoming web data traffic and increasing effective network bandwidth.
[0037] In this embodiment of the invention, the load balancing device cluster can be a Linux virtual server (LVS), which is a virtual server cluster system. The working principle of LVS includes: receiving user request information sent by the client; LVS forwarding the user request information to the backend server according to the forwarding method and algorithm; and the backend server receiving the user request information and sending response information to the client.
[0038] At the front end of the entire load balancing cluster, there are one or more DirectorServers. The DirectorServer is responsible for distributing client user requests to the corresponding backend servers of the application using a routing table. The load balancing cluster then forwards these requests to the backend servers based on the DirectorServer's distribution results.
[0039] FullNAT is a variation of Network Address Translation (NAT). FullNAT is a mode used by LVS. Most load balancers currently use FullNAT. When forwarding data, the load balancer performs network address translation, making it impossible for the backend server to obtain the real client's address information.
[0040] The working principle of FullNAT includes: First, the client sends the user request information to LVS; second, LVS modifies the destination address of the user request information to the backend server, changes the source address of the client to the LVS address information, and sends it to the backend server; then, after processing the user request information, the backend server returns the response information to LVS; finally, LVS changes the source address of the response message to the LVS address information and the destination address to the client, so as to send the response information to the client.
[0041] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP is designed to adapt to layered protocol hierarchies that support multiple network applications. Pairs of processes in host computers connected to different but interconnected computer networks rely on TCP for reliable communication services. TCP assumes it can obtain simple, potentially unreliable datagram services from lower-level protocols. In principle, TCP should be able to operate over a variety of communication systems, from hardwired connections to packet-switched or circuit-switched networks.
[0042] TOA (Terminal Address Allocation) is an implementation method in Full NAT mode that allows backend servers to obtain client address information. TOA is a functional module of the Layer 4 forwarding system. By default, services pass through the Layer 4 forwarding system, and the request address seen by the backend server is the NAT origin address. Normally, the function of TOA is to allow the backend server to obtain the client's address information. However, in scenarios where multi-level load balancers are deployed in series, using TOA, the backend server can only obtain the address information of the last-level load balancer.
[0043] The information transmission method provided in this embodiment of the invention can be applied to at least the following application scenarios, which will be described below.
[0044] FullNAT offers advantages such as cross-datacenter compatibility and high maintainability. However, on the backend server, applications can only obtain the LVS address information, not the actual client address information. Since most businesses now require user information analysis and profiling, and some sensitive businesses need to trace user origins, the actual client address information is crucial and necessary.
[0045] In scenarios where multi-level load balancers are deployed in series, using the TOA (Time-of-Action) approach, the backend server can only obtain the address information of the last-level load balancer; it cannot obtain the actual client's address information. Therefore, there is currently a problem where the backend server cannot obtain the actual client's address information.
[0046] Based on the above application scenarios, the information transmission method provided by the embodiments of the present invention will be described in detail below.
[0047] Information transmission methods such as Figure 1 As shown, the information transmission method may include steps 110-160. This method is applied to a system including a load balancing device cluster and a backend server. The load balancing device cluster includes multiple load balancing devices deployed in series, as shown below:
[0048] This involves a cluster of 100 load balancing devices.
[0049] Step 110: Receive user request information sent by the client. The user request information includes the client's address information.
[0050] Step 120: Store the client's address information in the Transmission Control Protocol (TCP) message options field.
[0051] In this embodiment of the invention, the client's address information has been added to the structure options in the TCP packet options field.
[0052] Step 130: Send the user request information and TCP packet option fields to the backend server. The TCP packet option fields include: the client's address information and the address information of each load balancer.
[0053] The client's address information includes client identification information. The backend server can obtain the client's address information from the target address information based on the client identification information. Therefore, the backend server can obtain the client's address information from the TCP packet options field, facilitating processing based on the client's address.
[0054] This involves the backend server 200.
[0055] Step 140: Receive user request information and TCP packet option fields sent by the load balancing device cluster.
[0056] Because of the multi-level forwarding of the TCP packet option field by multiple load balancing devices deployed in series, the TCP packet option field records the client's address information and the address information of each load balancing device that forwards the TCP packet option field.
[0057] Step 150: Parse the TCP packet options field to obtain the target address information, which includes the client's address information and the address information of each load balancer.
[0058] Because multiple load balancers deployed in series perform multi-level forwarding of the TCP packet option fields, the TCP packet option fields record the client's address information and the address information of each load balancer that forwards the TCP packet option fields. Therefore, parsing the TCP packet option fields yields target address information including the client's address information and the address information of each load balancer.
[0059] Step 160: Obtain the client's address information from the target address information.
[0060] The target address information includes the client's address information and the address information of each load balancer. The client's address information is required by the backend server, so it can be obtained from the target address information. Specifically, the client's address information includes client identification information, which can be used to retrieve the client's address from the target address information.
[0061] The information transmission method provided in this embodiment of the invention involves receiving user request information sent by a client. This user request information includes the client's address information. The client's address information is stored in the TCP packet option field, thus the TCP packet option field includes the client's address information. The TCP packet option field undergoes multi-level forwarding via multiple load balancers deployed in series. The TCP packet option field records both the client's address information and the address information of each load balancer that forwards the TCP packet option field. Finally, the user request information and the TCP packet option field are sent to a backend server. Therefore, the TCP packet option field received by the backend server includes both the client's address information and the address information of each load balancer. This allows the backend server to obtain the client's address information from the TCP packet option field, facilitating processing based on the client's address information.
[0062] Information transmission methods such as Figure 2 As shown, the information transmission method may include steps 210-230. This method is applied to a load balancing device cluster, which includes multiple load balancing devices deployed in series, as detailed below:
[0063] Step 210: Receive user request information sent by the client. The user request information includes the client's address information.
[0064] Step 220: Store the client's address information in the TCP packet options field.
[0065] The general structure of the TCP packet options field includes: the first field typically describes the type of option; the second field typically describes the total length of the option; and the third field typically describes specific information about the option.
[0066] In this embodiment of the invention, the client's address information has been added to the structure options in the TCP packet options field.
[0067] like Figure 3 As shown, the TCP packet option fields involved in this embodiment of the invention include: protocol number, option length, client port, and client address information.
[0068] Specifically, the TCP packet options field includes: "op code", "op size", "port", and "clientIP"; where "op code" represents the protocol number; "op size" represents the option length; "port" represents the client's port; and "clientIP" represents the client's address information.
[0069] In one possible embodiment, the following steps may be included before step 220:
[0070] Parse the user request information to obtain the client's address information.
[0071] The user request information may include: the client's port information, the client's address information, and the request content. The request content is used to make a business request to the backend server in order to obtain the response information returned by the backend server.
[0072] In one possible embodiment, the load balancing device cluster includes: Level 1 load balancing devices to Level N load balancing devices, where N is an integer greater than 1. Step 210 includes:
[0073] Receive user request information sent by the client through a Level 1 load balancer;
[0074] Accordingly, step 220 includes:
[0075] The client's address information and the address information of the Level 1 load balancer are stored in the TCP packet option field corresponding to the Level 1 load balancer. This is used to pass the TCP packet option field corresponding to the Level 1 load balancer to the Level 2 load balancer, and so on, until the Level N load balancer receives the user request information and the TCP packet option field corresponding to the Level N-1 load balancer.
[0076] Add the address information of the N-level load balancer to the TCP packet option field corresponding to the N-1-level load balancer to generate the TCP packet option field.
[0077] Here, firstly, the Level 1 load balancer receives the user request information sent by the client; then, it stores the client's address information and the Level 1 load balancer's address information in the TCP packet option field corresponding to the Level 1 load balancer, and passes the user request information and the TCP packet option field corresponding to the Level 1 load balancer to the Level 2 load balancer.
[0078] After receiving the user request information and the TCP packet option field corresponding to the Level 1 load balancer, the Level 2 load balancer adds the address information of the Level 2 load balancer to the TCP packet option field corresponding to the Level 1 load balancer, thus obtaining the TCP packet option field corresponding to the Level 2 load balancer. Then, the Level 2 load balancer passes the user request information and the TCP packet option field corresponding to the Level 2 load balancer to the Level 3 load balancer, and so on.
[0079] Based on the cascaded load balancing devices at each level, the TCP option fields of the user request information are continuously passed down. The N-1 level receives the TCP option fields of the N-2 level load balancing device and adds the address information of the N-1 level load balancing device to the TCP option fields of the N-2 level load balancing device, generating the TCP option fields of the N-1 level load balancing device, and so on, until it is passed to the N level load balancing device, which is the last device in the load balancing device cluster.
[0080] Next, the N-level load balancer adds its address information to the TCP option field of the corresponding N-1-level load balancer, generating the TCP option field. Finally, the N-level load balancer sends the TCP option field and the user request information to the backend server. Through multi-level forwarding of the TCP option field by multiple load balancers deployed in series, the TCP option field records the client's address information and the address information of each load balancer that forwarded the TCP option field.
[0081] Therefore, the TCP packet options field received by the backend server includes: the client's address information and the address information of each load balancer. The client's address information includes client identification information, which the backend server can use to retrieve the client's address information from the target address information. Thus, the backend server can obtain the client's address information from the TCP packet options field, facilitating processing based on that client's address.
[0082] Therefore, when a Level 1 load balancer receives a user's request, it stores the client's address information in the TCP option field of the packet and then forwards it to the Level 2 load balancer. And so on. Each subsequent level of load balancer, upon receiving the user request and TCP option field from the previous level, stores its own address information in the TCP option field, ensuring that the address information of each level of load balancer is preserved in the TCP option field.
[0083] Step 230: Send the user request information and TCP packet option fields to the backend server. The TCP packet option fields include: the client's address information and the address information of each load balancer.
[0084] In summary, the embodiments of the present invention receive user request information sent by a client, which includes the client's address information. This client's address information is stored in the TCP packet option field, thus the TCP packet option field includes the client's address information. Through multi-level forwarding of the TCP packet option field by multiple load balancing devices deployed in series, the TCP packet option field records both the client's address information and the address information of each load balancing device that forwards the TCP packet option field. Finally, the user request information and the TCP packet option field are sent to the backend server. Therefore, the TCP packet option field received by the backend server includes both the client's address information and the address information of each load balancing device. Thus, the backend server can obtain the client's address information from the TCP packet option field, facilitating processing based on the client's address information.
[0085] Figure 4 A flowchart of an information transmission method provided in an embodiment of the present invention.
[0086] like Figure 4 As shown, this information transmission method may include steps 410-430 and is applied to a backend server, as detailed below:
[0087] Step 410: Receive user request information and TCP packet option fields sent by the load balancing device cluster.
[0088] The system receives user request information and TCP packet option fields sent by the client to the load balancing device cluster. Due to the multi-level forwarding of the TCP packet option fields by multiple load balancing devices deployed in series, the TCP packet option fields record the client's address information and the address information of each load balancing device that forwards the TCP packet option fields.
[0089] Step 420: Parse the TCP packet options field to obtain the target address information, which includes the client's address information and the address information of each load balancer in the load balancer cluster.
[0090] Because of the multi-level forwarding of TCP packet option fields by multiple load balancers deployed in series, the TCP packet option fields record the client's address information and the address information of each load balancer that forwards the TCP packet option fields. Therefore, parsing the TCP packet option fields yields target address information including both the client's address information and the address information of each load balancer.
[0091] Step 430: Obtain the client's address information from the target address information.
[0092] The target address information includes: the client's address information and the address information of each load balancer. The client's address information is required by the backend server, so it can be obtained from the target address information.
[0093] Specifically, the client's address information includes client identification information, which can be used to obtain the client's address information from the target address information.
[0094] In summary, the embodiments of the present invention receive user request information and TCP packet option fields sent by a client to a load balancing device cluster. The load balancing device cluster comprises multiple load balancing devices deployed in series. Due to the multi-level forwarding of the TCP packet option fields by these multiple load balancing devices, the TCP packet option fields record the client's address information and the address information of each load balancing device that forwarded the TCP packet option fields. Therefore, parsing the TCP packet option fields yields target address information including the client's address information and the address information of each load balancing device. Consequently, the backend server can obtain the client's address information from the target address information, facilitating processing based on the client's address information.
[0095] Based on the above Figure 1 The information transmission method shown in the present invention also provides an information transmission system, such as... Figure 5 As shown, the information transmission system 500 includes: a load balancing device cluster 100 and a backend server 200. The load balancing device cluster includes multiple load balancing devices deployed in series.
[0096] Load balancing device cluster 100 is used to receive user request information sent by the client, the user request information including the client's address information; and to store the client's address information in the TCP packet option field; and to send the user request information and the TCP packet option field to the backend server 200, the TCP packet option field including: the client's address information and the address information of each load balancing device;
[0097] The backend server 200 is used to receive user request information and TCP packet option fields sent by the load balancing device cluster 100; and to parse the TCP packet option fields to obtain target address information, which includes the client's address information and the address information of each load balancing device; and to obtain the client's address information from the target address information.
[0098] The information transmission system provided in this embodiment of the invention involves a load balancing device cluster receiving user request information sent by a client. This user request information includes the client's address information, which is stored in the TCP packet option field. Therefore, the TCP packet option field contains the client's address information. Through multi-level forwarding of the TCP packet option field by multiple load balancing devices deployed in series, the TCP packet option field records both the client's address information and the address information of each load balancing device that forwards the TCP packet option field. Finally, the user request information and the TCP packet option field are sent to a backend server. Therefore, the TCP packet option field received by the backend server includes both the client's address information and the address information of each load balancing device. This allows the backend server to obtain the client's address information from the TCP packet option field, facilitating processing based on the client's address information.
[0099] Based on the above Figure 4 The information transmission method shown in this embodiment of the invention also provides an information transmission device applied to a backend server, such as... Figure 6 As shown, the information transmission device 600 may include:
[0100] The receiving module 610 is used to receive user request information and TCP packet option fields sent by the load balancing device cluster.
[0101] The parsing module 620 is used to parse the TCP packet option field to obtain the target address information, which includes the client's address information and the address information of each load balancer in the load balancer cluster.
[0102] The acquisition module 630 is used to obtain the client's address information from the target address information.
[0103] In summary, the embodiments of the present invention receive user request information and TCP packet option fields sent by a client to a load balancing device cluster. The load balancing device cluster comprises multiple load balancing devices deployed in series. Due to the multi-level forwarding of the TCP packet option fields by these multiple load balancing devices, the TCP packet option fields record the client's address information and the address information of each load balancing device that forwarded the TCP packet option fields. Therefore, parsing the TCP packet option fields yields target address information including the client's address information and the address information of each load balancing device. Consequently, the backend server can obtain the client's address information from the target address information, facilitating processing based on the client's address information.
[0104] This invention also provides an electronic device, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0105] Memory 703 is used to store computer programs;
[0106] When processor 701 executes a program stored in memory 703, it performs the following steps:
[0107] The load balancing device cluster receives user request information sent by the client, which includes the client's address information; and stores the client's address information in the Transmission Control Protocol (TCP) packet option field; and sends the user request information and the TCP packet option field to the backend server, whereby the TCP packet option field includes the client's address information and the address information of each load balancing device.
[0108] The backend server receives user request information and TCP packet option fields sent by the load balancing device cluster; and parses the TCP packet option fields to obtain target address information, which includes the client's address information and the address information of each load balancing device; and retrieves the client's address information from the target address information.
[0109] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0110] The communication interface is used for communication between the aforementioned terminal and other devices.
[0111] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0112] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0113] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the information transmission methods described in the above embodiments.
[0114] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the information transmission methods described in the above embodiments.
[0115] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0116] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0117] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0118] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. An information transmission method, characterized in that, Applied to a system including a load balancing device cluster and a backend server, wherein the load balancing device cluster comprises multiple load balancing devices deployed in series, the method includes: The load balancing device cluster receives user request information sent by a client, the user request information including the client's address information; and stores the client's address information in a Transmission Control Protocol (TCP) packet option field; and sends the user request information and the TCP packet option field to the backend server, the TCP packet option field including: the client's address information and the address information of each load balancing device; The backend server receives the user request information and the TCP packet option field sent by the load balancing device cluster; and parses the TCP packet option field to obtain target address information, the target address information including: the client's address information and the address information of each load balancing device; and obtains the client's address information from the target address information. The load balancing device cluster includes: Level 1 load balancing devices to Level N load balancing devices, where N is an integer greater than 1. Receiving user request information sent by the client includes: The user request information sent by the client is received through the Level 1 load balancing device; The step of storing the client's address information in the TCP packet options field includes: The address information of the client and the address information of the Level 1 load balancer are stored in the TCP packet option field corresponding to the Level 1 load balancer; The TCP packet option field corresponding to the Level 1 load balancer is passed to the Level 2 load balancer until the Level N load balancer receives the user request information and the TCP packet option field corresponding to the Level N-1 load balancer. The address information of the N-level load balancer is added to the TCP packet option field corresponding to the N-1-level load balancer to generate the TCP packet option field.
2. An information transmission method, characterized in that, Applied to a load balancing device cluster, the load balancing device cluster comprising multiple load balancing devices deployed in series, the method includes: Receive user request information sent by the client, wherein the user request information includes the client's address information; The client's address information is stored in the TCP packet options field; The user request information and the TCP packet option fields are sent to the backend server. The TCP packet option fields include: the client's address information and the address information of each load balancing device. The load balancing device cluster includes: Level 1 load balancing devices to Level N load balancing devices, where N is an integer greater than 1. Receiving user request information sent by the client includes: The user request information sent by the client is received through the Level 1 load balancing device; The step of storing the client's address information in the TCP packet options field includes: The address information of the client and the address information of the Level 1 load balancer are stored in the TCP packet option field corresponding to the Level 1 load balancer; The TCP packet option field corresponding to the Level 1 load balancer is passed to the Level 2 load balancer until the Level N load balancer receives the user request information and the TCP packet option field corresponding to the Level N-1 load balancer. The address information of the N-level load balancer is added to the TCP packet option field corresponding to the N-1-level load balancer to generate the TCP packet option field.
3. The method according to claim 2, characterized in that, Before storing the client's address information in the TCP packet options field, the method further includes: The user request information is parsed to obtain the client's address information.
4. An information transmission method, characterized in that, Applied to a backend server, the method includes: Receive user request information and TCP packet option fields sent by the load balancing device cluster; Parse the TCP packet option field to obtain the target address information, which includes: the client's address information and the address information of each load balancing device in the load balancing device cluster; Obtain the client's address information from the target address information; The load balancing device cluster includes: Level 1 load balancing devices to Level N load balancing devices, where N is an integer greater than 1. The load balancing device cluster receives user request information sent by clients, including: The user request information sent by the client is received through the Level 1 load balancing device; The load balancing device cluster stores the client's address information in the TCP packet options field, including: The address information of the client and the address information of the Level 1 load balancer are stored in the TCP packet option field corresponding to the Level 1 load balancer; The TCP packet option field corresponding to the Level 1 load balancer is passed to the Level 2 load balancer until the Level N load balancer receives the user request information and the TCP packet option field corresponding to the Level N-1 load balancer. The address information of the N-level load balancer is added to the TCP packet option field corresponding to the N-1-level load balancer to generate the TCP packet option field.
5. An information transmission system, characterized in that, The system includes: a load balancing device cluster and a backend server. The load balancing device cluster includes multiple load balancing devices deployed in series. The load balancing device cluster is configured to receive user request information sent by a client, the user request information including the client's address information; store the client's address information in a TCP packet option field; and send the user request information and the TCP packet option field to a backend server, the TCP packet option field including: the client's address information and the address information of each load balancing device. The backend server is configured to receive the user request information and the TCP packet option field sent by the load balancing device cluster; and to parse the TCP packet option field to obtain target address information, the target address information including: the client's address information and the address information of each load balancing device; and to obtain the client's address information from the target address information. The load balancing device cluster includes: Level 1 load balancing devices to Level N load balancing devices, where N is an integer greater than 1. Receiving user request information sent by the client includes: The user request information sent by the client is received through the Level 1 load balancing device; The step of storing the client's address information in the TCP packet options field includes: The address information of the client and the address information of the Level 1 load balancer are stored in the TCP packet option field corresponding to the Level 1 load balancer; The TCP packet option field corresponding to the Level 1 load balancer is passed to the Level 2 load balancer until the Level N load balancer receives the user request information and the TCP packet option field corresponding to the Level N-1 load balancer. The address information of the N-level load balancer is added to the TCP packet option field corresponding to the N-1-level load balancer to generate the TCP packet option field.
6. An information transmission device, characterized in that, The device, applied to a backend server, includes: The receiving module is used to receive user request information and TCP packet option fields sent by the load balancing device cluster; The parsing module is used to parse the TCP packet option field to obtain the target address information, which includes: the client's address information and the address information of each load balancing device in the load balancing device cluster; The acquisition module is used to acquire the client's address information from the target address information; The load balancing device cluster includes: Level 1 load balancing devices to Level N load balancing devices, where N is an integer greater than 1. The load balancing device cluster receives user request information sent by clients, including: The user request information sent by the client is received through the Level 1 load balancing device; The load balancing device cluster stores the client's address information in the TCP packet options field, including: The address information of the client and the address information of the Level 1 load balancer are stored in the TCP packet option field corresponding to the Level 1 load balancer; The TCP packet option field corresponding to the Level 1 load balancer is passed to the Level 2 load balancer until the Level N load balancer receives the user request information and the TCP packet option field corresponding to the Level N-1 load balancer. The address information of the N-level load balancer is added to the TCP packet option field corresponding to the N-1-level load balancer to generate the TCP packet option field.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.