Information processing method, device and storage medium

By analyzing the data access request in K8s and modifying the address of the response information, the processing speed reduction problem caused by the increase in the bandwidth of the computing node is solved, and the effect of reducing bandwidth and improving processing speed is achieved.

CN115883644BActive Publication Date: 2025-04-15JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211474087.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-04-15
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

In K8s, when the number of data access request and response information increases, the bandwidth of the computing node increases, resulting in a decrease in processing speed.

Method used

By analyzing the data access request, obtaining the request forwarding address and the client address, modifying the second address in the response information into the request forwarding address, generating the updated response information, and transmitting it to the client.

Benefits of technology

The bandwidth of the information processing device is reduced, the processing speed of data access requests is improved, and multiple transmissions of response information between computing nodes are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883644B_ABST
    Figure CN115883644B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses an information processing method and device, and a storage medium, including: upon receiving a first data access request transmitted by a second information processing device, parsing the first data access request to obtain a request forwarding address and a first address; the request forwarding address is the address of the second information processing device; generating corresponding response information according to the first data access request; modifying the second address in the response information to the request forwarding address to obtain updated response information; the second address is the address of the first information processing device; and transmitting the updated response information to a client corresponding to the first address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and in particular to an information processing method and device, and a storage medium. Background Art

[0002] The services on the container orchestration management platform (kubernetes, K8S) expose ClusterIP, NodePort, and load balancer to implement the load balancing process of data access requests through these services.

[0003] In the related technology, data access requests and their corresponding response information will pass through the same computing node with a forwarding program. When the number of data access requests increases, the number of corresponding response information will also increase accordingly. However, the number of computing nodes in K8s is limited. When the number of data access requests and response information is large, the bandwidth of the computing node containing the forwarding program will increase, reducing the speed at which the computing node processes data access requests. Summary of the invention

[0004] In order to solve the above technical problems, the embodiments of the present application hope to provide an information processing method and device, and a storage medium, which can improve the processing speed of data access requests.

[0005] The technical solution of this application is implemented as follows:

[0006] The present application provides an information processing method, which is applied to a first information processing device. The information processing method includes:

[0007] When receiving a first data access request transmitted by a second information processing device, parsing the first data access request to obtain a request forwarding address and a first address; the request forwarding address is the address of the second information processing device;

[0008] generating corresponding response information according to the first data access request;

[0009] Modify the second address in the response information to the request forwarding address to obtain updated response information; the second address is the address of the first information processing device;

[0010] Transmit the updated response information to the client corresponding to the first address.

[0011] The present application provides an information processing method, which is applied to a second information processing device. The information processing method includes:

[0012] Upon receiving a second data access request transmitted by the client, obtaining a request forwarding address from the second data access request;

[0013] Determine a first information processing device according to the request forwarding address, and obtain a second address of the first information processing device;

[0014] adjusting the second data access request using the request forwarding address and the second address to obtain a first data access request;

[0015] The first data access request is sent to the first information processing device.

[0016] The present application provides a first information processing device, the device comprising:

[0017] a parsing unit, configured to, upon receiving a first data access request transmitted by a second information processing device, parse the first data access request to obtain a request forwarding address and a first address; the request forwarding address being an address of the second information processing device;

[0018] A generating unit, configured to generate corresponding response information according to the first data access request;

[0019] A first modifying unit, configured to modify a second address in the response information to the request forwarding address, to obtain updated response information; the second address is an address of the first information processing device;

[0020] A transmission unit, used for transmitting the updated response information to the client corresponding to the first address.

[0021] An embodiment of the present application provides a second information processing device, the device comprising:

[0022] A first acquisition unit is configured to, upon receiving a second data access request transmitted by a client, acquire a request forwarding address from the second data access request; and acquire a second address of the first information processing device;

[0023] a determining unit, configured to determine a first information processing device according to the request forwarding address;

[0024] an adjusting unit, configured to adjust the second data access request by using the request forwarding address and the second address to obtain a first data access request;

[0025] A sending unit is used to send the first data access request to the first information processing device.

[0026] The present application provides a first information processing device, the device comprising:

[0027] A first memory, a first processor and a first communication bus, wherein the first memory communicates with the first processor via the first communication bus, the first memory stores an information processing program executable by the first processor, and when the information processing program is executed, the above-mentioned information processing method applied to the first information processing device is executed by the first processor.

[0028] An embodiment of the present application provides a second information processing device, the device comprising:

[0029] A second memory, a second processor and a second communication bus, wherein the second memory communicates with the second processor via the second communication bus, and the second memory stores an information processing program executable by the second processor. When the information processing program is executed, the information processing method applied to the second information processing device described above is executed by the second processor.

[0030] An embodiment of the present application provides a storage medium having a computer program stored thereon, which is applied to a first information processing device and a second information processing device, and is characterized in that when the computer program is executed by the first processor, the information processing method applied to the first information processing device is implemented; when the computer program is executed by the second processor, the information processing method applied to the second information processing device is implemented.

[0031] The embodiment of the present application provides an information processing method and device, and a storage medium. The information processing method includes: when receiving a first data access request transmitted by a second information processing device, parsing the first data access request to obtain a request forwarding address and a first address; the request forwarding address is the address of the second information processing device; generating corresponding response information according to the first data access request; modifying the second address in the response information to the request forwarding address to obtain updated response information; the second address is the address of the first information processing device; transmitting the updated response information to the client corresponding to the first address. The above method is implemented, the first information processing device parses the first data access request to obtain the first address and the request forwarding address of the client, and modifies the second address in the response information to the request forwarding address, so that the client can think that the updated response information is sent by the second information processing device according to the request forwarding address, and can directly identify the updated response information, so that there is no need to use the second information processing device to transmit the response information to the client according to the transmission reverse path of the data access request. In the case of a large number of data access requests and response information, the bandwidth of the information processing device is reduced, that is, the bandwidth of the computing node is reduced, and the processing speed of the data access request is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] FIG1( a ) is a schematic diagram of a ClusterIP mode in the prior art provided in an embodiment of the present application;

[0033] FIG1( b ) is a schematic diagram of a NodePort mode in the prior art provided in an embodiment of the present application;

[0034] FIG1( c ) is a schematic diagram of a load balancer mode in the prior art provided in an embodiment of the present application;

[0035] FIG2(a) is a schematic diagram of request and response data flow of a ClusterIP mode in the prior art provided in an embodiment of the present application;

[0036] FIG2( b ) is a schematic diagram of request and response data flow of a NodePort mode in the prior art provided in an embodiment of the present application;

[0037] FIG2( c ) is a schematic diagram of request and response data flow of a load balancing mode in the prior art provided by an embodiment of the present application;

[0038] Figure 3 A flowchart of an information processing method provided in an embodiment of the present application;

[0039] Figure 4 An exemplary information processing block diagram provided for an embodiment of the present application;

[0040] Figure 5 A flow chart 2 of an information processing method provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of an exemplary request data sent within a k8s cluster provided in an embodiment of the present application;

[0042] Figure 7 An exemplary schematic diagram of request data sent out by a k8s cluster provided in an embodiment of the present application;

[0043] Figure 8 A schematic diagram of the structure of a first information processing device provided in an embodiment of the present application;

[0044] Fig. 9 A second schematic diagram of the structure of a first information processing device provided in an embodiment of the present application;

[0045] Fig.10 A schematic diagram of the structure of a second information processing device provided in an embodiment of the present application;

[0046] Fig.11 A second schematic diagram of the composition structure of a second information processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

[0048] In the prior art: As shown in Figure 1(a), ClusterIP is only accessible to workloads within the k8s cluster. By deploying a forwarding program on the computing node, the requests sent by the workload on the computing node are forwarded to the workloads on other nodes. As shown in Figure 2(a): ClusterIP is only accessible within the cluster.

[0049] As shown in Figure 1(b): The NodePort method also deploys a forwarding program on the computing node. The workload (request end) outside the k8s cluster can access the computing node IP and the assigned port where the workload is located, and the forwarding program on the computing node forwards the access request to the workload in the cluster. As shown in Figure 2(b): With the NodePort method, both request and response data need to pass through the computing node. For requests that require a large amount of data transmission, it will affect the bandwidth of the computing node and consume the computing performance of the computing point. At the same time, it is necessary to introduce additional high-availability mechanisms, such as switching DNS using the service active health check detection mechanism, etc. The horizontal expansion capability is not good, and TCP ports need to be allocated from the computing node. Due to the number of ports, the number of services supported is limited.

[0050] As shown in Figure 1(c): Load balancer (LB) refers to relying on traditional load balancing equipment to assign a service IP and port to the service in the k8s cluster. The client's request first reaches the load balancer, which forwards the request to the workload in the k8s cluster. As shown in Figure 2(c): With load balancing, both requests and responses outside the cluster and within the cluster need to be transferred through it, which has a relatively high latency. Due to the large traffic between east-west workloads, a load balancing service cluster with greater processing power is required, which is relatively expensive.

[0051] To address the deficiencies in the prior art, the methods in the following embodiments may be used.

[0052] The present application embodiment provides an information processing method, wherein the information processing method is applied to a first information processing device. Figure 3 A flow chart of an information processing method provided in an embodiment of the present application, such as Figure 3 As shown, the information processing method may include:

[0053] S101. Upon receiving a first data access request transmitted by a second information processing device, parse the first data access request to obtain a request forwarding address and a first address; the request forwarding address is the address of the second information processing device.

[0054] An information processing method provided in an embodiment of the present application is suitable for a scenario in which load balancing is performed on data access requests in K8s.

[0055] In the embodiments of the present application, the first information processing device can be implemented in various forms. For example, the first information processing device described in the present application may include devices such as mobile phones, cameras, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, and devices such as digital TVs, desktop computers, and servers.

[0056] In an embodiment of the present application, the first information processing device is a computing node within K8s, the second information processing device can be a client (i.e., a computing node outside the K8s cluster), and the second information processing device can also be a computing node within K8s (i.e., other computing nodes except the first information processing device); the specific second information processing device can be determined according to actual conditions, and the embodiment of the present application does not limit this.

[0057] In an embodiment of the present application, if the second information processing device is a computing node other than the first information processing device in K8s, the first data access request may be a request generated by the second information processing device; or the first data access request may be a request to forward the second data access request generated by the client to the first information processing device through the second information processing device.

[0058] In the embodiment of the present application, the first information processing device includes an address translation module (ReqMux-NAT-Agent) for parsing the first data access request to obtain the first address and the request forwarding address.

[0059] In the embodiment of the present application, if the first data access request is a request to forward the second data access request generated by the client to the first information processing device through the second information processing device, the first address is the address of the client.

[0060] In an embodiment of the present application, if the first data access request is a request generated by the second information processing device, then upon receiving the first data access request, the first information processing device parses the first data access request, and the obtained request forwarding address is the same as the first address, both of which are the address of the second information processing device.

[0061] It should be noted that the first address can be an Internet Protocol (IP) / Transmission Control Protocol (TCP) address, or other addresses; the specific first address can be determined based on actual conditions, and the embodiments of the present application do not limit this.

[0062] It should be noted that the request forwarding address may be an IP / TCP address; the request forwarding address may also be other addresses; the specific request forwarding address may be determined based on actual conditions, and the embodiments of the present application do not limit this.

[0063] In an embodiment of the present application, the address conversion module is deployed in each computing node in the K8s cluster.

[0064] In the embodiment of the present application, the first data access request may be an access request for any data; the specific first data access request may be determined based on actual conditions, and the embodiment of the present application does not limit this.

[0065] In the embodiment of the present application, the manner in which the first information processing device parses the first data access request is an existing technical manner; the specific manner can be determined based on actual conditions, and the embodiment of the present application does not limit this.

[0066] In an embodiment of the present application, the process in which the first information processing device, upon receiving a first data access request transmitted by a second information processing device, parses the first data access request to obtain a first address and a request forwarding address includes: the first information processing device, upon receiving the first data access request and the first data access request carries a preset identifier, parses the first data access request to obtain the first address and the request forwarding address.

[0067] In the embodiment of the present application, the preset identifier carried in the first data access request may be: the identifier of the preset identifier field in the IP option in the first data access request is the preset identifier.

[0068] It should be noted that the preset identifier may be an unallocated identifier, and the preset identifier complies with the Request for Comments (RFC) regulations.

[0069] Exemplarily, the preset identifier may be a code, or may be other identifiers; the specific preset identifier may be determined according to actual conditions, and the embodiments of the present application do not limit this.

[0070] In the embodiment of the present application, the first data access request includes an IP header and an IP message, and the destination address of the request is recorded in the IP option in the IP message (for the first data access request sent to the second information processing device, the destination address is the address of the second information processing device). Specifically, the IP option consists of three fields: code, length, and value, wherein the information in value is the request forwarding address, the information in length is the length value of the information in Value, and code is a preset identifier.

[0071] In an embodiment of the present application, after the first information processing device parses the first data access request and obtains the first address and the request forwarding address, the first information processing device also establishes a first corresponding relationship between the first address, the second address and the request forwarding address.

[0072] It should be noted that the second address is the device that actually processes the first data access request and generates corresponding response information, that is, the address of the first information processing device.

[0073] It should be noted that the first address includes the source IP and source port (Port) of the client; the second address includes the destination IP and destination port (Port) of the first information processing device.

[0074] In an embodiment of the present application, the first information processing device also obtains a transport layer protocol, such as a Transmission Control Protocol (TCP) / User Datagram Protocol (UDP), from the first data access request.

[0075] In an embodiment of the present application, the first information processing device uses the first address, the second address and the transport layer protocol as keys and the request forwarding address as the corresponding value to obtain a kv key-value pair, that is, a first corresponding relationship.

[0076] S102: Generate corresponding response information according to the first data access request.

[0077] In the embodiment of the present application, after the first information processing device parses the first data access request and obtains the request forwarding address and the first address, the first information processing device generates corresponding response information according to the first data access request.

[0078] In the embodiment of the present application, the process of the first information processing device generating corresponding response information according to the first data access request is a prior art, and the embodiment of the present application does not limit this.

[0079] S103, modify the second address in the response information to the request forwarding address, and obtain updated response information; the second address is the address of the first information processing device.

[0080] In an embodiment of the present application, after the first information processing device generates corresponding response information according to the first data access request, the first information processing device modifies the second address in the response information to the request forwarding address to obtain updated response information.

[0081] In an embodiment of the present application, the first information processing device may delete the second address in the response information and write the requested forwarding address in the position of the second address, thereby obtaining updated response information; the specific implementation method of the first information processing device modifying the second address in the response information to the requested forwarding address to obtain the updated response information can be determined according to actual conditions, and the embodiment of the present application does not limit this.

[0082] In an embodiment of the present application, the process in which the first information processing device modifies the second address in the response information to the request forwarding address to obtain the updated response information includes the first information processing device obtaining the destination sending address of the response information, the second address carried in the response information, and the request forwarding address; establishing a second correspondence between the destination sending address, the second address, and the request forwarding address; and when the first correspondence matches the second correspondence, modifying the second address in the response information to the request forwarding address to obtain the updated response information.

[0083] In the embodiment of the present application, the generated response information carries the second address.

[0084] In an embodiment of the present application, the manner in which the first information processing device establishes a second correspondence between the destination sending address, the second address and the request forwarding address is the same as the manner in which the information processing device establishes a first correspondence between the first address, the second address and the request forwarding address.

[0085] In an embodiment of the present application, when the first information processing device determines that the request forwarding address in the first relationship is the same as the request forwarding address in the second relationship, the second address in the first relationship is the same as the second address in the second relationship, and the first address in the first relationship is the same as the destination sending address in the second relationship, the first information processing device determines that the first corresponding relationship matches the second corresponding relationship.

[0086] S104: Transmit updated response information to the client corresponding to the first address.

[0087] In an embodiment of the present application, the first information processing device modifies the second address in the response information to the request forwarding address, and after obtaining the updated response information, the first information processing device transmits the updated response information to the client corresponding to the first address.

[0088] In an embodiment of the present application, ReqMux-NAT-Agent is used to parse an IP message sent to a first information processing device (a first data access request is composed of multiple IP messages). If a code field is included in the IP option of the IP message, the field is parsed to obtain the request forwarding address before being modified by the request distribution module (ReqMux) in the second information processing device, and a record is generated. The key of the record is the five-tuple information extracted from the IP message (source IP, source port, destination IP, destination port, transport layer protocol), and the value of the record is the request forwarding address, thereby obtaining a first corresponding relationship. For the IP message sent by the first information processing device, the five-tuple information is also extracted according to the above method to obtain a second corresponding relationship, and it is checked whether there is a record (to determine whether the first corresponding relationship matches the second corresponding relationship). If so (the first corresponding relationship matches the second corresponding relationship), the second address in the response information is modified to the request forwarding address to obtain an updated response information.

[0089] For example, Figure 4 As shown: ReqMux-NAT-Agent is divided into two parts, such as Figure 4 As shown in ②, for the message sent to the first information processing device, the program logic is connected in series to the message processing link (LocalIN) of the operating system protocol stack for the message sent to the first information processing device through the HOOK mechanism of the operating system. By setting the priority, the address conversion (DNAT, destination address conversion) program is executed preferentially for the message sent to the first information processing device. For example, the Linux system uses the netfilter framework to register the hook function on the PREROUTING chain to parse the incoming IP message (parse the received message or the generated message). If the IP option of the IP message includes a code field, the field is parsed to obtain the request forwarding address before being modified by the ReqMux in the second information processing device, and a record is generated. The key of the record is the five-tuple information (source IP, source port, destination IP, destination port, transport layer protocol) extracted from the IP message, and the value of the record is the request forwarding address, thereby obtaining the first corresponding relationship. The other part is for the message sent by the first information processing device, such as Figure 4As shown in ③, through the HOOK mechanism of the operating system, the program logic is connected in series to the message processing link (LocalOut) of the operating system protocol stack for the first information processing device. By setting the priority, this program is executed preferentially for the message sent to the first information processing device. For example, the Linux system uses the netfilter framework to register the hook function on the POSTROUTING chain, extract the five-tuple information, obtain the second correspondence, and search for the information saved in ② (determine whether the first correspondence matches the second correspondence). If found (that is, the first correspondence matches the second correspondence), the second address in the response information is modified to the request forwarding address (SNAT, source address translation) to obtain the updated response information.

[0090] It can be understood that the first information processing device obtains the first address and request forwarding address of the client by parsing the first data access request, and modifies the second address in the response information to the request forwarding address, so that the client can believe that the updated response information is sent by the second information processing device based on the request forwarding address, and can directly identify the updated response information, thereby eliminating the need to use the second information processing device to transmit the response information to the client along the reverse path of the data access request. When the number of data access requests and response information is large, the bandwidth of the information processing device is reduced, that is, the bandwidth of the computing node is reduced, and at the same time, the processing speed of the data access request is improved.

[0091] The embodiment of the present application provides an information processing method, wherein the information processing method is applied to a second information processing device. Figure 5 A flow chart of an information processing method provided in an embodiment of the present application, such as Figure 5 As shown, the information processing method may include:

[0092] S201. Upon receiving a second data access request transmitted by a client, obtain a request forwarding address from the second data access request.

[0093] An information processing method provided in an embodiment of the present application is suitable for a scenario in which load balancing is performed on data access requests in K8s.

[0094] In the embodiments of the present application, the second information processing device can be implemented in various forms. For example, the second information processing device described in the present application may include devices such as mobile phones, cameras, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, and devices such as digital TVs, desktop computers, and servers.

[0095] In an embodiment of the present application, the second information processing device carries a request distribution module (ReqMux) for processing a second data access request transmitted by the client to the second information processing device or a second data access request generated by the second information processing device, obtains a first data access request, and sends it to the first information processing device.

[0096] In an embodiment of the present application, ReqMux is deployed in each computing node in the K8s cluster.

[0097] In an embodiment of the present application, the client is a computing node outside the K8s cluster, and the second information processing device is other computing nodes in the K8s cluster except the first information processing device.

[0098] In an embodiment of the present application, if the second data access request is a request generated by a second information processing device, then when the second information processing device generates the second data access request, the second information processing device determines the first information processing device based on the request forwarding address (that is, the address of the second information processing device, and the second data access request generated by the second information processing device carries the request forwarding address) and obtains the second address of the first information processing device; adjusts the second data access request using the request forwarding address and the second address to obtain the first data access request; and sends the first data access request to the first information processing device.

[0099] In the embodiment of the present application, the second data access request carries a request forwarding address and a first address of the client, wherein the first address is the address of the client.

[0100] It should be noted that the first address may be an IP / TCP address, or other addresses; the specific first address may be determined based on actual conditions, and the embodiments of the present application do not limit this.

[0101] It should be noted that the request forwarding address may be an IP / TCP address; the request forwarding address may also be other addresses; the specific request forwarding address may be determined based on actual conditions, and the embodiments of the present application do not limit this.

[0102] It should be noted that the second address may be an IP / TCP address; the second address may also be other addresses; the specific second address may be determined based on actual conditions, and the embodiments of the present application do not limit this.

[0103] In the embodiment of the present application, the second data access request may be an access request for any data; the specific second data access request may be determined based on actual conditions, and the embodiment of the present application does not limit this.

[0104] In an embodiment of the present application, when the second information processing device receives the second data access request transmitted by the client, before obtaining the request forwarding address from the second data access request, the second information processing device will also use the dynamic routing protocol to broadcast the request forwarding address; or call the cluster external interface to register the request forwarding address.

[0105] In an embodiment of the present application, the second information processing device includes a routing module (RouteAgent) for broadcasting a request forwarding address using a dynamic routing protocol; or calling a cluster external interface to register a request forwarding address so that the client can transmit a second data access request to the second information processing device according to the request forwarding address.

[0106] In an embodiment of the present application, the second information processing device may also broadcast a request forwarding address to the client in other ways; the specific way in which the second information processing device broadcasts a request forwarding address to the client can be determined based on actual conditions, and the embodiment of the present application does not limit this.

[0107] It should be noted that the routing module is deployed in some computing nodes within the K8s cluster, such as the routing forwarding module is deployed in the second information processing device within the K8s cluster.

[0108] S202: Determine the first information processing device according to the request forwarding address, and obtain the second address of the first information processing device.

[0109] In an embodiment of the present application, after the second information processing device obtains the request forwarding address from the second data access request, the second information processing device determines the first information processing device based on the request forwarding address and obtains the second address of the first information processing device.

[0110] In the embodiment of the present application, the method in which the second information processing device determines the first information processing device according to the request forwarding address is an existing technical method; the specific embodiment of the present application does not limit this.

[0111] S203: Use the request forwarding address and the second address to adjust the second data access request to obtain the first data access request.

[0112] In an embodiment of the present application, after the second information processing device determines the first information processing device based on the request forwarding address and obtains the second address of the first information processing device, the second information processing device uses the request forwarding address and the second address to adjust the second data access request to obtain the first data access request.

[0113] In an embodiment of the present application, the process in which the second information processing device uses the request forwarding address and the second address to adjust the second data access request to obtain the first data access request includes: the second information processing device determines the first message header based on the second address; uses the first message header to modify the second message header in the second data access request to obtain the third data access request; adds the request forwarding address to the third data access request to obtain the first data access request.

[0114] In the embodiment of the present application, if the second address is an IP / TCP address, the first message header can be determined according to the format of the message header of the message in the second data access request and the IP / TCP address.

[0115] In an embodiment of the present application, the process in which the second information processing device adds a request forwarding address in the third data access request to obtain the first data access request includes: the second information processing device adds a request forwarding address in the data message of the third data access request to obtain the first data access request.

[0116] In an embodiment of the present application, the second data access request includes at least one message, each of the at least one message includes an IP header and an IP message, and the IP option in the IP message consists of three fields: code, length and value, wherein the value of the value field is the requested forwarding address, the value of the length field is the length value of the information in the Value; code is a preset identifier.

[0117] In an embodiment of the present application, the second information processing device adds a request forwarding address to the data message of the third data access request to obtain the first data access request. The second information processing device can set the value of the value field of the data message (IP message) to the request forwarding address, and use the value of the length field to identify the information length of the request forwarding address information; and set the code to obtain the first data access request.

[0118] S204: Send a first data access request to the first information processing device.

[0119] In an embodiment of the present application, the second information processing device adjusts the second data access request using the request forwarding address and the second address, and after obtaining the first data access request, the second information processing device sends the first data access request to the first information processing device.

[0120] In an embodiment of the present application, ReqMux is used to receive a second data access request and match the request forwarding address (ip, port) of the request. After matching, the first information processing device (back-end server) is determined based on the request forwarding address, and the message header (IP header and TCP header) of the second data access request is modified. The corresponding IP and TCP port of the request forwarding address are modified to the IP and service port of the first information processing device, and the destination request address (i.e., the address of the first information processing device) is recorded in the IP option of the IP message of the second data access request.

[0121] Exemplarily, ReqMux can connect the program logic in series to the message processing link sent to the second information processing device by the operating system protocol stack through the HOOK mechanism of the operating system. By setting the priority, the request dispatching program is executed preferentially for the message sent to the second information processing device. For example, the Linux system uses the netfilter framework to register the hook function on the LOCAL_IN chain. For all messages sent to the second information processing device, obtain the request forwarding address (IP and port number) of the message, search the exposed service list through the IP and port number, and if found, select a backend server (workload, i.e., the first information processing device) through a consistent hashing algorithm (such as the maglev consistent hashing algorithm), modify the message header of the second data access request, modify the corresponding IP and TCP port of the request forwarding address to the IP and service port (DNAT) of the first information processing device, and record the request forwarding address (ip, port) in the IP option of the IP message. The IP option consists of three fields: code, length, and value. The value of the value field is the request forwarding address, and the value of the length field is the length value of the information in the Value. The code is a preset identifier that complies with the IPv4 RFC and IPv6 RFC protocols. The preset identifier is a private code and does not conflict with other programs within the organization.

[0122] For example, Figure 6As shown: a client outside the cluster (workload: 10.1.2.3) transmits a second data access request to a second information processing device (computing node 1) in the K8s cluster; the second information processing device (ReqMux in) obtains a request forwarding address (172.1.2.1:80) from the second data access request; the first information processing device is determined according to the request forwarding address, and the second address of the first information processing device (192.168.1.3:8080) is obtained; the first message header is determined according to the second address; the second message header in the second data access request is modified using the first message header to obtain a third data access request; the request forwarding address is added to the third data access request to obtain the first data access request; and the first data access request is sent to the first information processing device. When the first information processing device (computing node 2) receives the first data access request transmitted by the second information processing device, the ReqMux-NAT-Agent in the second information processing device parses the first data access request to obtain the first address and the request forwarding address; generates corresponding response information according to the first data access request; ReqMux-NAT-Agent modifies the second address in the response information to the request forwarding address to obtain updated response information; and transmits the updated response information to the client corresponding to the first address (workload: 10.1.2.3).

[0123] For example, Figure 7 As shown: When the second information processing device (computing node 1) in the K8s cluster generates a second data access request, the second information processing device determines the first information processing device according to the request forwarding address (i.e., the address of the second information processing device), and obtains the second address of the first information processing device; adjusts the second data access request using the request forwarding address and the second address to obtain the first data access request; and sends the first data access request to the first information processing device. When the first information processing device (computing node 2) in the K8s cluster receives the first data access request transmitted by the second information processing device, the ReqMux-NAT-Agent in the second information processing device parses the first data access request to obtain the first address and the request forwarding address; at this time, the first address and the request forwarding address are the same, and the corresponding response information is generated according to the first data access request; the ReqMux-NAT-Agent modifies the second address in the response information to the request forwarding address to obtain the updated response information; and transmits the updated response information to the client corresponding to the first address (workload: 10.1.2.3).

[0124] It can be understood that, when the second information processing device receives the second data access request transmitted by the client, it adjusts the second data access request using the request forwarding address and the second address to obtain the first data access request, that is, adds the request forwarding address and the second address to the second data access request, so that the first information processing device can modify the second address in the response information to the request forwarding address, so that the client can believe that the updated response information is sent by the second information processing device based on the request forwarding address, and can directly identify the updated response information, thereby eliminating the need to use the second information processing device to transmit the response information to the client according to the reverse transmission path of the data access request. When the number of data access requests and response information is large, the bandwidth of the information processing device is reduced, that is, the bandwidth of the computing node is reduced, and the processing speed of the data access request is improved.

[0125] Based on the same inventive concept as the information processing method applied to the first information processing device, the embodiment of the present application provides a first information processing device 1 corresponding to an information processing method; Figure 8 A schematic diagram of a first information processing device provided in an embodiment of the present application is shown in FIG. 1 . The first information processing device 1 may include:

[0126] The parsing unit 11 is used to parse the first data access request transmitted by the second information processing device to obtain a request forwarding address and a first address when receiving the first data access request transmitted by the second information processing device; the request forwarding address is the address of the second information processing device;

[0127] A generating unit 12, configured to generate corresponding response information according to the first data access request;

[0128] A first modifying unit 13 is used to modify the second address in the response information to the request forwarding address to obtain updated response information; the second address is the address of the first information processing device;

[0129] The transmission unit 14 is configured to transmit the updated response information to the client corresponding to the first address.

[0130] In some embodiments of the present application, the parsing unit 11 is used to parse the first data access request when the first data access request is received and the first data access request carries a preset identifier, to obtain the request forwarding address and the first address.

[0131] In some embodiments of the present application, the apparatus further comprises an establishing unit;

[0132] The establishing unit is used to establish a first corresponding relationship between the first address, the second address and the request forwarding address.

[0133] In some embodiments of the present application, the apparatus further includes a second acquisition unit;

[0134] The second acquisition unit is used to acquire the destination sending address of the response information, the second address in the response information, and the request forwarding address;

[0135] The establishing unit is used to establish a second corresponding relationship between the destination sending address, the second address and the request forwarding address;

[0136] The first modifying unit 13 is configured to modify the second address in the response information to the request forwarding address when the first corresponding relationship matches the second corresponding relationship, so as to obtain the updated response information.

[0137] It should be noted that, in actual applications, the above-mentioned parsing unit 11, generating unit 12, first modifying unit 13 and transmitting unit 14 can be implemented by the first processor 15 on the first information processing device 1, specifically, a CPU (Central Processing Unit), an MPU (Microprocessor Unit), a DSP (Digital Signal Processing) or a field programmable gate array (FPGA); the above-mentioned data storage can be implemented by the first memory 16 on the first information processing device 1.

[0138] The present application embodiment also provides a first information processing device 1, such as Fig. 9 As shown, the first information processing device 1 includes: a first processor 15, a first memory 16 and a first communication bus 17. The first memory 16 communicates with the first processor 15 through the first communication bus 17. The first memory 16 stores a program executable by the first processor 15. When the program is executed, the information processing method described above is executed by the first processor 15.

[0139] In practical applications, the first memory 16 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the first processor 15.

[0140] An embodiment of the present application provides a computer-readable storage medium having a computer program thereon, and when the program is executed by the first processor 15 , the information processing method as described above is implemented.

[0141] It can be understood that the first information processing device obtains the first address and request forwarding address of the client by parsing the first data access request, and modifies the second address in the response information to the request forwarding address, so that the client can believe that the updated response information is sent by the second information processing device based on the request forwarding address, and can directly identify the updated response information, thereby eliminating the need to use the second information processing device to transmit the response information to the client along the reverse path of the data access request. When the number of data access requests and response information is large, the bandwidth of the information processing device is reduced, that is, the bandwidth of the computing node is reduced, and at the same time, the processing speed of the data access request is improved.

[0142] Based on the same inventive concept as the information processing method applied to the second information processing device, the embodiment of the present application provides a second information processing device 2 corresponding to an information processing method; Fig.10 A schematic diagram of the composition structure of a second information processing device provided in an embodiment of the present application is shown in FIG. 1 . The second information processing device 2 may include:

[0143] The first acquisition unit 21 is configured to, upon receiving a second data access request transmitted by a client, acquire a request forwarding address from the second data access request; and acquire a second address of the first information processing device;

[0144] A determination unit 22, configured to determine a first information processing device according to the request forwarding address;

[0145] An adjusting unit 23, configured to adjust the second data access request using the request forwarding address and the second address to obtain a first data access request;

[0146] The sending unit 24 is configured to send the first data access request to the first information processing device.

[0147] In some embodiments of the present application, the apparatus further comprises a second modifying unit and an adding unit;

[0148] The determining unit 22 is used to determine the first message header according to the second address;

[0149] The second modification unit is used to modify the second message header in the second data access request by using the first message header to obtain a third data access request;

[0150] The adding unit is used to add the request forwarding address to the third data access request to obtain the first data access request.

[0151] In some embodiments of the present application, the adding unit is used to add the request forwarding address to the data message of the third data access request to obtain the first data access request.

[0152] In some embodiments of the present application, the apparatus further includes a broadcast unit and a registration unit;

[0153] The broadcast unit is used to broadcast the request forwarding address using a dynamic routing protocol;

[0154] Or the registration unit is used to call the cluster external interface to register the request forwarding address.

[0155] It should be noted that, in actual applications, the above-mentioned first acquisition unit 21, determination unit 22, adjustment unit 23 and sending unit 24 can be implemented by the second processor 25 on the second information processing device 2, specifically a CPU (Central Processing Unit), MPU (Microprocessor Unit), DSP (Digital Signal Processing) or a field programmable gate array (FPGA); the above-mentioned data storage can be implemented by the second memory 26 on the second information processing device 2.

[0156] The present application embodiment also provides a second information processing device 2, such as Fig.11As shown, the second information processing device 2 includes: a second processor 25, a second memory 26 and a second communication bus 27. The second memory 26 communicates with the second processor 25 via the second communication bus 27. The second memory 26 stores a program executable by the second processor 25. When the program is executed, the information processing method described above is executed by the second processor 25.

[0157] In practical applications, the second memory 26 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the second processor 25.

[0158] An embodiment of the present application provides a computer-readable storage medium having a computer program thereon, and when the program is executed by the second processor 25, the information processing method as described above is implemented.

[0159] It can be understood that, when the second information processing device receives the second data access request transmitted by the client, it adjusts the second data access request using the request forwarding address and the second address to obtain the first data access request, that is, adds the request forwarding address and the second address to the second data access request, so that the first information processing device can modify the second address in the response information to the request forwarding address, so that the client can believe that the updated response information is sent by the second information processing device based on the request forwarding address, and can directly identify the updated response information, thereby eliminating the need to use the second information processing device to transmit the response information to the client according to the reverse transmission path of the data access request. When the number of data access requests and response information is large, the bandwidth of the information processing device is reduced, that is, the bandwidth of the computing node is reduced, and the processing speed of the data access request is improved.

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

[0161] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0162] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0164] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. An information processing method, characterized in that: Applied to a first information processing device, the first information processing device being a computing node in a container orchestration management platform K8s, the method comprises: When receiving a first data access request transmitted by a second information processing device, parsing the first data access request to obtain a request forwarding address and a first address; the request forwarding address is the address of the second information processing device; generating corresponding response information according to the first data access request; Modify the second address in the response information to the request forwarding address to obtain updated response information; the second address is the address of the first information processing device; Transmit the updated response information to the client corresponding to the first address.

2. The method according to claim 1, characterized in that The step of, upon receiving a first data access request transmitted by a second information processing device, parsing the first data access request to obtain a request forwarding address and a first address includes: When the first data access request is received and the first data access request carries a preset identifier, the first data access request is parsed to obtain the request forwarding address and the first address.

3. The method according to claim 1, characterized in that After parsing the first data access request to obtain the request forwarding address and the first address, the method further includes: A first corresponding relationship between the first address, the second address and the request forwarding address is established.

4. The method according to claim 1, characterized in that: The step of modifying the second address in the response information to the request forwarding address to obtain updated response information includes: Obtaining the destination sending address of the response information, the second address in the response information, and the request forwarding address; Establishing a second corresponding relationship between the destination sending address, the second address and the request forwarding address; In the case where the first corresponding relationship matches the second corresponding relationship, the second address in the response information is modified to the request forwarding address to obtain the updated response information.

5. An information processing method, characterized in that: Applied to a second information processing device, the method includes: Upon receiving a second data access request transmitted by the client, obtaining a request forwarding address from the second data access request; Determine a first information processing device according to the request forwarding address, and obtain a second address of the first information processing device; the first information processing device is a computing node in the container orchestration management platform K8s; adjusting the second data access request using the request forwarding address and the second address to obtain a first data access request; The first data access request is sent to the first information processing device.

6. The method according to claim 5, characterized in that The adjusting the second data access request by using the request forwarding address and the second address to obtain the first data access request includes: Determine a first message header according to the second address; Using the first message header to modify the second message header in the second data access request to obtain a third data access request; The request forwarding address is added to the third data access request to obtain the first data access request.

7. The method according to claim 6, characterized in that Adding the request forwarding address to the third data access request to obtain the first data access request includes: The request forwarding address is added to the data message of the third data access request to obtain the first data access request.

8. The method according to claim 5, characterized in that In the case of receiving a second data access request transmitted by the client, before obtaining the request forwarding address from the second data access request, the method further includes: Broadcasting the request forwarding address using a dynamic routing protocol; Or call the cluster external interface to register the request forwarding address.

9. A first information processing device, characterized in that: The first information processing device is a computing node in the container orchestration management platform K8s, and the device includes: a parsing unit, configured to, upon receiving a first data access request transmitted by a second information processing device, parse the first data access request to obtain a request forwarding address and a first address; the request forwarding address being an address of the second information processing device; A generating unit, configured to generate corresponding response information according to the first data access request; A first modifying unit, configured to modify a second address in the response information to the request forwarding address, to obtain updated response information; the second address is an address of the first information processing device; A transmission unit, used for transmitting the updated response information to the client corresponding to the first address.

10. A second information processing device, characterized in that: The device comprises: A first acquisition unit is used to acquire a request forwarding address from a second data access request transmitted by a client upon receiving the second data access request; and acquire a second address of a first information processing device; the first information processing device is a computing node in a container orchestration management platform K8s; a determining unit, configured to determine a first information processing device according to the request forwarding address; an adjusting unit, configured to adjust the second data access request by using the request forwarding address and the second address to obtain a first data access request; A sending unit, configured to send the first data access request to the first information processing device.

11. A first information processing device, characterized in that: The device comprises: A first memory, a first processor and a first communication bus, wherein the first memory communicates with the first processor via the first communication bus, the first memory stores an information processing program executable by the first processor, and when the information processing program is executed, the method described in any one of claims 1 to 4 is performed by the first processor.

12. A second information processing device, characterized in that: The device comprises: A second memory, a second processor and a second communication bus, wherein the second memory communicates with the second processor via the second communication bus, and the second memory stores an information processing program executable by the second processor, and when the information processing program is executed, the method described in any one of claims 5 to 8 is performed by the second processor.

13. A storage medium having a computer program stored thereon, applied to a first information processing device and a second information processing device, characterized in that: When the computer program is executed by a first processor, the method described in any one of claims 1 to 4 is implemented; when the computer program is executed by a second processor, the method described in any one of claims 5 to 8 is implemented.

Citation Information

Patent Citations

  • Containerized application request copying method and system based on Kubernetes, medium and equipment

    CN112860375A

  • Service access method and device, gateway equipment and storage medium

    CN113472831A